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));
288 if( norm_inf < row_sum)
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;
INDEX Index
The type to use for all integer numbers and indices.
void matrix_exp(MatrixView F, ConstMatrixView A, const Index &q)
General exponential of a Matrix.
void lubacksub(VectorView x, ConstMatrixView LU, ConstVectorView b, const ArrayOfIndex &indx)
LU backsubstitution.
Linear algebra functions.
Index nelem() const
Returns the number of elements.
This file contains the definition of Array.
void mult(VectorView y, const ConstMatrixView &M, const ConstVectorView &x)
Matrix Vector multiplication.
Index ncols() const
Returns the number of columns.
The global header file for ARTS.
void ludcmp(MatrixView LU, ArrayOfIndex &indx, ConstMatrixView A)
LU decomposition.
NUMERIC Numeric
The type to use for all floating point numbers.
Header file for logic.cc.
This can be used to make arrays out of anything.
The class MakeVector is a special kind of Vector that can be initialized explicitly from one or more ...
void resize(Index n)
Assignment operator from VectorView.
A constant view of a Vector.
A constant view of a Matrix.
bool is_size(ConstVectorView x, const Index &n)
Verifies that the size of x is l.
void id_mat(MatrixView I)
Identity Matrix.
void linreg(Vector &p, ConstVectorView x, ConstVectorView y)
Index nrows() const
Returns the number of rows.
Numeric det(ConstMatrixView A)
Numeric norm_inf(ConstMatrixView A)
Maximum absolute row sum norm.