91 template <
class MaTRiX,
class VecToRSubscript>
94 BIASASSERT(A.lbound() == 1);
95 BIASASSERT(indx.lbound() == 1);
100 if (M == 0 || N==0)
return 0;
107 typename MaTRiX::element_type t;
111 for (j=1; j<= minMN; j++)
118 for (i=j+1; i<=M; i++)
119 if ( fabs(A(i,j)) > t)
147 typename MaTRiX::element_type recp = 1.0 / A(j,j);
149 for (k=j+1; k<=M; k++)
164 for (ii=j+1; ii<=M; ii++)
165 for (jj=j+1; jj<=N; jj++)
166 A(ii,jj) -= A(ii,j)*A(j,jj);
176 template <
class MaTRiX,
class VecToR,
class VecToRSubscripts>
177 int LU_solve(
const MaTRiX &A,
const VecToRSubscripts &indx, VecToR &b)
179 BIASASSERT(A.lbound() == 1);
180 BIASASSERT(indx.lbound() == 1);
181 BIASASSERT(b.lbound() == 1);
185 typename MaTRiX::element_type sum = 0.0;
193 for (j=ii;j<=i-1;j++)
TNT_SUBSCRIPT_TYPE Subscript
int LU_factor(MaTRiX &A, VecToRSubscript &indx)
int LU_solve(const MaTRiX &A, const VecToRSubscripts &indx, VecToR &b)