#include <tnt_linalg.h>
Public Member Functions | |
LU (const Matrix< Real > &A) | |
int | isNonsingular () |
Matrix< Real > | getL () |
Matrix< Real > | getU () |
Vector< int > | getPivot () |
Real | det () |
Matrix< Real > | solve (const Matrix< Real > &B) |
Vector< Real > | solve (const Vector< Real > &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.
TNT::Linear_Algebra::LU< Real >::LU | ( | const Matrix< Real > & | A | ) | [inline] |
Real TNT::Linear_Algebra::LU< Real >::det | ( | ) | [inline] |
Compute determinant using LU factors.
Matrix<Real> TNT::Linear_Algebra::LU< Real >::getL | ( | ) | [inline] |
Return lower triangular factor
Vector<int> TNT::Linear_Algebra::LU< Real >::getPivot | ( | ) | [inline] |
Return pivot permutation vector
Matrix<Real> TNT::Linear_Algebra::LU< Real >::getU | ( | ) | [inline] |
Return upper triangular factor
int TNT::Linear_Algebra::LU< Real >::isNonsingular | ( | ) | [inline] |
Is the matrix nonsingular?
Vector<Real> TNT::Linear_Algebra::LU< Real >::solve | ( | const Vector< Real > & | b | ) | [inline] |
Matrix<Real> TNT::Linear_Algebra::LU< Real >::solve | ( | const Matrix< Real > & | B | ) | [inline] |
Solve A*X = B
B | A Matrix with as many rows as A and any number of columns. |