68 for (
Index i=0; i<dim; i++)
72 for (
Index j=0; j<dim; j++)
74 if ((
temp =
abs(LU(i,j))) > big)
78 throw runtime_error(
"ludcmp: Matrix is singular");
82 for (
Index j=0; j<dim; j++)
84 for (
Index i=0; i<j; i++)
87 for (
Index k=0; k<i; k++)
88 sum -= LU(i,k)*LU(k,j);
92 for(
Index i=j; i<dim; i++)
95 for (
Index k=0; k<j; k++)
96 sum -= LU(i,k)*LU(k,j);
98 if( (dum = vv[i]*fabs(sum)) >= big)
106 for(
Index k=0; k<dim; k++)
109 LU(imax,k) = LU(j,k);
118 if(LU(j,j) == 0.0) LU(j,j) = TINY;
123 for (
Index i=j+1; i<dim; i++)
155 for(
Index i=0; i<dim; i++)
160 for (
Index i=0; i<dim; i++)
163 for (
Index j=0; j<=i-1; j++)
168 for(
Index i=dim-1; i>=0; i--)
171 for (
Index j=i+1; j<dim; j++)
207 Matrix D(n,n),
N(n,n), X(n,n), cX(n,n,0.0), B(n,n,0.0);
208 Vector N_col_vec(n,0.), F_col_vec(n,0.);
213 j = 1 + floor(1./log(2.)*log(A_norm_inf));
234 c *= (q_n-k_n+1)/((2*q_n-k_n+1)*k_n);
252 for(
Index i=0; i<n; i++)
255 lubacksub(F_col_vec, X, N_col_vec, indx);
256 F(
joker,i) = F_col_vec;
260 for(
Index k=0; k<j_index; k++)
286 row_sum +=
abs(A(i,j));
303 assert(n == I.
nrows());
306 for(
Index i=0; i<n; i++)
323 assert(dim == A.
ncols());
326 return A(0,0)*A(1,1)*A(2,2) + A(0,1)*A(1,2)*A(2,0) +
327 A(0,2)*A(1,0)*A(2,1) - A(0,2)*A(1,1)*A(2,0) -
328 A(0,1)*A(1,0)*A(2,2) - A(0,0)*A(1,2)*A(2,1);
330 return A(0,0) * A(1,1) - A(0,1) * A(1,0);
336 for(
Index j = 0; j < dim; j++)
339 for(
Index I = 1; I < dim; I++)
340 for(
Index J = 0; J < dim; J++)
343 temp(I-1,J) = A(I,J);
345 temp(I-1,J-1) = A(I,J);
350 ret_val += ((j%2 == 0)?-1.:1.) * tempNum * A(0,j);
378 assert( y.
nelem() == n );
406 Numeric s1=0, xm=0, s3=0, s4=0;
408 for(
Index i=0; i<n; i++ )
411 for(
Index i=0; i<n; i++ )
420 p[0] = s3/
Numeric(n) - p[1]*xm;