ARTS  2.0.49
lin_alg.cc File Reference

Linear algebra functions. More...

#include "lin_alg.h"
#include <stdexcept>
#include <cmath>
#include "arts.h"
#include "make_vector.h"
#include "array.h"
#include "logic.h"

Go to the source code of this file.

Functions

void ludcmp (MatrixView LU, ArrayOfIndex &indx, ConstMatrixView A)
 LU decomposition. More...
 
void lubacksub (VectorView x, ConstMatrixView LU, ConstVectorView b, const ArrayOfIndex &indx)
 LU backsubstitution. More...
 
void matrix_exp (MatrixView F, ConstMatrixView A, const Index &q)
 Exponential of a Matrix. More...
 
Numeric norm_inf (ConstMatrixView A)
 Maximum absolute row sum norm. More...
 
void id_mat (MatrixView I)
 Identity Matrix. More...
 

Detailed Description

Linear algebra functions.

Author
Claudia Emde claud.nosp@m.ia.e.nosp@m.mde@d.nosp@m.lr.d.nosp@m.e
Date
Thu May 2 10:59:55 2002

This file contains mathematical tools to solve the vector radiative transfer equation.

Definition in file lin_alg.cc.

Function Documentation

◆ id_mat()

void id_mat ( MatrixView  I)

Identity Matrix.

Parameters
IOutput: identity matrix

Definition at line 298 of file lin_alg.cc.

References ConstMatrixView::ncols(), and ConstMatrixView::nrows().

Referenced by get_ppath_cloudrtvars(), matrix_exp(), MCGeneral(), MCIPA(), mcPathTraceGeneral(), mcPathTraceIPA(), and rte_step_std().

◆ lubacksub()

void lubacksub ( VectorView  x,
ConstMatrixView  LU,
ConstVectorView  b,
const ArrayOfIndex indx 
)

LU backsubstitution.

Solves a set of linear equations Ax=b. It is neccessairy to do a LU
decomposition using the function ludcp before using this function.

Parameters
xOutput: Solution vector of the equation system.
LUInput: LU decomposition of the matrix (output of function ludcp).
bInput: Right-hand-side vector of equation system.
indxInput: Pivoting information (output of function ludcp).

Definition at line 144 of file lin_alg.cc.

References is_size(), and ConstMatrixView::nrows().

Referenced by matrix_exp(), rte_step_std(), test_lusolve1D(), and test_lusolve4D().

◆ ludcmp()

void ludcmp ( MatrixView  LU,
ArrayOfIndex indx,
ConstMatrixView  A 
)

LU decomposition.

This function performes a LU Decomposition of the matrix A. (Compare Numerical Recipies in C, pages 36-48.)

Parameters
LUOutput: returns L and U in one matrix
indxOutput: Vector that records the row permutation.
AInput: Matrix for which the LU decomposition is performed

Definition at line 53 of file lin_alg.cc.

References abs, is_size(), ConstMatrixView::nrows(), and temp.

Referenced by matrix_exp(), rte_step_std(), test_lusolve1D(), and test_lusolve4D().

◆ matrix_exp()

void matrix_exp ( MatrixView  F,
ConstMatrixView  A,
const Index q 
)

Exponential of a Matrix.

The exponential of a matrix is computed using the Pade-Approximation. The method is decribed in: Golub, G. H. and C. F. Van Loan, Matrix Computation, p. 384, Johns Hopkins University Press, 1983.

Parameters
FOutput: The matrix exponential of A (Has to be initialized before calling the function.
AInput: arbitrary square matrix
qInput: Parameter for the accuracy of the computation

Definition at line 193 of file lin_alg.cc.

References id_mat(), is_size(), joker, lubacksub(), ludcmp(), mult(), N, ConstMatrixView::ncols(), norm_inf(), and q.

Referenced by ext2trans(), rte_step_std(), test_matrix_exp1D(), test_matrix_exp3D(), and test_matrix_exp4D().

◆ norm_inf()

Numeric norm_inf ( ConstMatrixView  A)

Maximum absolute row sum norm.

This function returns the maximum absolute row sum norm of a matrix A (see user guide for the definition).

Parameters
AInput: arbitrary matrix
Returns
Maximum absolute row sum norm

Definition at line 275 of file lin_alg.cc.

References abs, ConstMatrixView::ncols(), norm_inf(), and ConstMatrixView::nrows().

Referenced by matrix_exp(), and norm_inf().