@classmethod
def ETKInvert(cls, A, norder, error):
    """Matrix= reference to matrix of doulbes
          Norder = order of matrix  (assumed square)
          Error 	= 0 if no error;
                 = 1 if not enough heap to alloc temp array
                 = 2 if matrix can't be inverted

        This routine will invert a non-symmetric matrix.  Index is assumed to
        follow the FORTRAN standard, not the Pascal standard.  That is the data
        are ordered by first subscript first, then second subscript.  This routine
        computes its own indexing, leaving nothing to the whims of a cantankerous compiler.

        It assumes that the matrix is dimensioned to exactly the number of elements
        needed.  Apologies to Fortran users who are accustomed to over dimensioning
        stuff.
        """
    cls.L = norder
    error.setValue(0)
    LT = [None] * cls.L
    if len(LT) == 0:
        error.setValue(1)
        return
    _0 = True
    j = 0
    while True:
        if _0 is True:
            _0 = False
        else:
            j += 1
        if not j < cls.L:
            break
        LT[j] = 0
    T1 = 0.0
    k = 1
    _1 = True
    M = 0
    while True:
        if _1 is True:
            _1 = False
        else:
            M += 1
        if not M < cls.L:
            break
        _2 = True
        LL = 0
        while True:
            if _2 is True:
                _2 = False
            else:
                LL += 1
            if not LL < cls.L:
                break
            if LT[LL] != 1:
                RMY = cls.Math.abs(A[cls.index(LL, LL)]) - cls.Math.abs(T1)
                if RMY > 0.0:
                    T1 = A[cls.index(LL, LL)]
                    k = LL
        RMY = cls.Math.abs(T1)
        if RMY == 0.0:
            error.setValue(2)
            return
        T1 = 0.0
        LT[k] = 1
        _3 = True
        i = 0
        while True:
            if _3 is True:
                _3 = False
            else:
                i += 1
            if not i < cls.L:
                break
            if i != k:
                _4 = True
                j = 0
                while True:
                    if _4 is True:
                        _4 = False
                    else:
                        j += 1
                    if not j < cls.L:
                        break
                    if j != k:
                        A[cls.index(i, j)] = A[cls.index(i, j)] - A[cls.
                            index(i, k)] * A[cls.index(k, j)] / A[cls.index
                            (k, k)]
        A[cls.index(k, k)] = -1.0 / A[cls.index(k, k)]
        _5 = True
        i = 0
        while True:
            if _5 is True:
                _5 = False
            else:
                i += 1
            if not i < cls.L:
                break
            if i != k:
                A[cls.index(i, k)] = A[cls.index(i, k)] * A[cls.index(k, k)]
                A[cls.index(k, i)] = A[cls.index(k, i)] * A[cls.index(k, k)]
    _6 = True
    j = 0
    while True:
        if _6 is True:
            _6 = False
        else:
            j += 1
        if not j < cls.L:
            break
        _7 = True
        k = 0
        while True:
            if _7 is True:
                _7 = False
            else:
                k += 1
            if not k < cls.L:
                break
            A[cls.index(j, k)] = -A[cls.index(j, k)]
    LT = None
