TBCI Numerical high perf. C++ Library  2.8.0
Macros | Functions
lu_solver.h File Reference
#include "tbci/matrix.h"
#include "tbci/vector.h"
Include dependency graph for lu_solver.h:

Go to the source code of this file.

Macros

#define MLU_MINVAL   5e-16
 
#define MLU_RES_WARN   1e-11
 

Functions

template<typename T >
NAMESPACE_TBCI int lu_decomp (Matrix< T > &mat)
 LU decomposes the TBCI::Matrix mat. More...
 
template<typename T >
TVector< TLU_fwd_subst (const Matrix< T > &lu, const Vector< T > &y)
 
template<typename T >
TVector< TLU_bkw_subst (const Matrix< T > &lu, const Vector< T > &y)
 
template<typename T >
TVector< TLU_solve (const Matrix< T > &lu, const Vector< T > &b)
 
template<typename T >
TVector< Tlu_solve (Matrix< T > &mat, const Vector< T > &b)
 
template<typename T >
TMatrix< TLU_solve (const Matrix< T > &lu, const Matrix< T > &b)
 
template<typename T >
TMatrix< Tlu_solve (Matrix< T > &mat, const Matrix< T > &b)
 
template<typename T >
T LU_det (const Matrix< T > &lu)
 calculates determinant of an already LU decomposed Matrix More...
 
template<typename T >
T lu_det (Matrix< T > &mat)
 calculates determinant of a Matrix by LU decomposition More...
 
template<typename T >
TMatrix< TLU_invert (const Matrix< T > &mat)
 Returns the inverse of a already LU decomposed Matrix. More...
 
template<typename T >
TMatrix< Tlu_invert (Matrix< T > &mat)
 Returns the inverse of a Matrix by performing a LU decomposition. More...
 

Detailed Description

LU solver implementation (TBCI::lu_decomp)

LU decomposizes a TBCI::Matrix and solves the vector equation Ax = b

LU_xxxx operates on an already LU decomposed Matrix, whereas lu_xxxx does decompose it and then does * the requested action (eg. determinant calculation ...)

NOTE: the matrix passed as argument to lu_xxxx will be modified!

Date
23.06.97
Author
Kurt Garloff
Version
Id:
lu_solver.h,v 1.15.2.23 2022/11/03 17:28:12 garloff Exp

License: GNU LGPL

Definition in file lu_solver.h.

Macro Definition Documentation

#define MLU_MINVAL   5e-16

Definition at line 32 of file lu_solver.h.

Referenced by lu_decomp().

#define MLU_RES_WARN   1e-11

Definition at line 37 of file lu_solver.h.

Referenced by lu_solve().

Function Documentation

template<typename T >
TVector<T> LU_bkw_subst ( const Matrix< T > &  lu,
const Vector< T > &  y 
)
template<typename T >
NAMESPACE_TBCI int lu_decomp ( Matrix< T > &  mat)

LU decomposes the TBCI::Matrix mat.

Decomposition is compactly stored in one Matrix The diagonal elements of the lower Matrix are all 1 (this is a feature of the algorithm).

Note
The Matrix passed will be changed!

Definition at line 94 of file lu_solver.h.

References ALIGN2, BCHK, TMatrix< T >::columns(), EL_PER_CL, err, std::fabs(), TMatrix< T >::get(), TMatrix< T >::getcref(), i, LIKELY, MATH__, MAX, MIN, MIN_ALIGN2, MLU_MINVAL, PREFETCH_R, REGISTER, TMatrix< T >::rows(), TMatrix< T >::setval(), T, and UNLIKELY.

Referenced by lu_det(), lu_invert(), and lu_solve().

template<typename T >
T LU_det ( const Matrix< T > &  lu)

calculates determinant of an already LU decomposed Matrix

Definition at line 281 of file lu_solver.h.

References ALIGN2, BCHK, TMatrix< T >::columns(), TMatrix< T >::get(), i, MIN_ALIGN2, REGISTER, TMatrix< T >::rows(), and T.

template<typename T >
T lu_det ( Matrix< T > &  mat)
inline

calculates determinant of a Matrix by LU decomposition

Definition at line 293 of file lu_solver.h.

References lu_decomp(), and LU_det().

template<typename T >
TVector<T> LU_fwd_subst ( const Matrix< T > &  lu,
const Vector< T > &  y 
)
template<typename T >
TMatrix<T> LU_invert ( const Matrix< T > &  mat)

Returns the inverse of a already LU decomposed Matrix.

Definition at line 303 of file lu_solver.h.

References BCHK, TMatrix< T >::columns(), inv(), LU_solve(), TMatrix< T >::rows(), T, v, and y.

template<typename T >
TMatrix<T> lu_invert ( Matrix< T > &  mat)
inline

Returns the inverse of a Matrix by performing a LU decomposition.

Definition at line 320 of file lu_solver.h.

References lu_decomp(), and LU_invert().

template<typename T >
TVector<T> LU_solve ( const Matrix< T > &  lu,
const Vector< T > &  b 
)
inline

Solve the equation Ax = b where A IS already LU decomposed

Definition at line 225 of file lu_solver.h.

References LU_bkw_subst(), LU_fwd_subst(), and y.

template<typename T >
TVector<T> lu_solve ( Matrix< T > &  mat,
const Vector< T > &  b 
)

Solve the equation Ax = b where A still needs to be LU decomposed

Note
The Matrix passed will be changed by the LU decomposition!

Definition at line 240 of file lu_solver.h.

References BCHK, BVector< T >::copy(), std::fabs(), lu_decomp(), LU_solve(), MATH__, MLU_RES_WARN, res, TVector< T >::size(), and x.

template<typename T >
TMatrix<T> LU_solve ( const Matrix< T > &  lu,
const Matrix< T > &  b 
)
template<typename T >
TMatrix<T> lu_solve ( Matrix< T > &  mat,
const Matrix< T > &  b 
)
inline

Definition at line 272 of file lu_solver.h.

References lu_decomp(), and LU_solve().