Feel++
0.91.4
|
#include <lu.hpp>
Public Types | |
typedef MatrixType::value_type | value_type |
typedef MatrixType | matrix_type |
typedef boost::numeric::ublas::vector < value_type > | vector_type |
typedef boost::numeric::ublas::vector < uint > | vector_uint_type |
Public Member Functions | |
LU (const matrix_type &A) | |
uint | isNonsingular () |
matrix_type | getL () |
matrix_type | getU () |
vector_uint_type | getPivot () |
value_type | det () |
void | inverse (matrix_type &__inv) |
matrix_type | solve (const matrix_type &B) |
vector_type | solve (const vector_type &b) |
LU Decomposition.
For an m-by-n matrix A with m >= n, the LU decomposition is an m-by-n unit lower triangular matrix L, an n-by-n upper triangular matrix U, and a permutation vector piv of length m so that A(piv,:) = L*U. If m < n, then L is m-by-m and U is m-by-n.
The LU decompostion with pivoting always exists, even if the matrix is singular, so the constructor will never fail. The primary use of the LU decomposition is in the solution of square systems of simultaneous linear equations. This will fail if isNonsingular() returns false.
Compute determinant using LU factors.
Referenced by Feel::GeoND< Dim, GEOSHAPE, T, GeoElement0D< Dim, SubFaceOfNone, T > >::isAnticlockwiseOriented().
Return lower triangular factor
Return pivot permutation vector
Return upper triangular factor
uint Feel::LU< MatrixType >::isNonsingular | ( | ) | [inline] |
Is the matrix nonsingular?
Referenced by Feel::LU< MatrixType >::solve().
matrix_type Feel::LU< MatrixType >::solve | ( | const matrix_type & | B | ) | [inline] |
Solve A*X = B
B | A Matrix with as many rows as A and any number of columns. |
References Feel::LU< MatrixType >::isNonsingular().
vector_type Feel::LU< MatrixType >::solve | ( | const vector_type & | b | ) | [inline] |
Solve A*x = b, where x and b are vectors of length equal to the number of rows in A.
b | a vector (Array1D> of length equal to the first dimension of A. |
References Feel::LU< MatrixType >::isNonsingular().