TBCI Numerical high perf. C++ Library  2.8.0
Macros | Functions
bd_lu_solver.h File Reference

LU solver for TBCI::BdMatrix class (TBCI::lu_decomp) More...

#include "tbci/vector.h"
#include "tbci/band_matrix.h"
#include "tbci/matrix.h"
Include dependency graph for bd_lu_solver.h:

Go to the source code of this file.

Macros

#define BDMLU_MINVAL   1e-16
 
#define BDMLU_RES_WARN   1e-11
 

Functions

template<typename T >
NAMESPACE_TBCI int lu_decomp (BdMatrix< T > &mat)
 LU decompose a TBCI::BdMatrix. More...
 
template<typename T >
TVector< TLU_fwd_subst (const BdMatrix< T > &lu, const Vector< T > &y)
 
template<typename T >
TVector< TLU_bkw_subst (const BdMatrix< T > &lu, const Vector< T > &y)
 
template<typename T >
TVector< TLU_solve (const BdMatrix< T > &lu, const Vector< T > &b)
 Solve the equation Ax = b where A IS already LU decomposed. More...
 
template<typename T >
TVector< Tlu_solve (BdMatrix< T > &mat, const Vector< T > &b)
 Solve the equation Ax = b where A still needs to be LU decomposed. More...
 
template<typename T >
TMatrix< TLU_solve (const BdMatrix< T > &lu, const Matrix< T > &b)
 
template<typename T >
TMatrix< Tlu_solve (BdMatrix< T > &mat, const Matrix< T > &b)
 
template<typename T >
T LU_det (const BdMatrix< T > &lu)
 calculates determinant of an already LU decomposed BdMatrix More...
 
template<typename T >
T lu_det (BdMatrix< T > &mat)
 calculates the determinant of a BdMatrix by doing an LU decomposition More...
 
template<typename T >
TMatrix< TLU_invert (const BdMatrix< T > &lu)
 return the inverse Matrix for an already LU decomposed BdMatrix More...
 
template<typename T >
TMatrix< Tlu_invert (BdMatrix< T > &mat)
 return the inverse Matrix for a BdMatrix by doing an LU decomposition More...
 

Detailed Description

LU solver for TBCI::BdMatrix class (TBCI::lu_decomp)

LU decomposizes a BdMatrix and solves the Vector equation Ax = b

Definition in file bd_lu_solver.h.

Macro Definition Documentation

#define BDMLU_MINVAL   1e-16

Definition at line 33 of file bd_lu_solver.h.

Referenced by lu_decomp().

#define BDMLU_RES_WARN   1e-11

Definition at line 38 of file bd_lu_solver.h.

Referenced by lu_solve().

Function Documentation

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

LU decompose a TBCI::BdMatrix.

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

Note
The BdMatrix passed will be changed!

Definition at line 57 of file bd_lu_solver.h.

References ALIGN2, BCHK, BDMLU_MINVAL, BdMatrix< T >::expand(), std::fabs(), BdMatrix< T >::get(), BdMatrix< T >::getmaxoff(), i, MATH__, MAX, MIN, MIN_ALIGN2, REGISTER, BdMatrix< T >::rows(), BdMatrix< T >::setval(), STD__, T, and UNLIKELY.

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

calculates determinant of an already LU decomposed BdMatrix

Definition at line 317 of file bd_lu_solver.h.

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

Referenced by lu_det().

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

calculates the determinant of a BdMatrix by doing an LU decomposition

Definition at line 329 of file bd_lu_solver.h.

References lu_decomp(), and LU_det().

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

return the inverse Matrix for an already LU decomposed BdMatrix

Definition at line 338 of file bd_lu_solver.h.

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

Referenced by lu_invert().

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

return the inverse Matrix for a BdMatrix by doing an LU decomposition

Definition at line 355 of file bd_lu_solver.h.

References lu_decomp(), and LU_invert().

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

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

Definition at line 246 of file bd_lu_solver.h.

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

Referenced by LU_invert(), and lu_solve().

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

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

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

Definition at line 260 of file bd_lu_solver.h.

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

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

Definition at line 295 of file bd_lu_solver.h.

References lu_decomp(), and LU_solve().