#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) |
Private Member Functions | |
Matrix< Real > | permute_copy (const Matrix< Real > &A, const Vector< int > &piv, int j0, int j1) |
Vector< Real > | permute_copy (const Vector< Real > &A, const Vector< int > &piv) |
Private Attributes | |
Matrix< Real > | LU_ |
int | m |
int | n |
int | pivsign |
Vector< int > | piv |
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.
Definition at line 1251 of file tnt_linalg.h.
TNT::Linear_Algebra::LU< Real >::LU | ( | const Matrix< Real > & | A | ) | [inline] |
LU Decomposition
A | Rectangular matrix |
Definition at line 1301 of file tnt_linalg.h.
Real TNT::Linear_Algebra::LU< Real >::det | ( | ) | [inline] |
Compute determinant using LU factors.
Definition at line 1438 of file tnt_linalg.h.
Matrix<Real> TNT::Linear_Algebra::LU< Real >::getL | ( | ) | [inline] |
Vector<int> TNT::Linear_Algebra::LU< Real >::getPivot | ( | ) | [inline] |
Matrix<Real> TNT::Linear_Algebra::LU< Real >::getU | ( | ) | [inline] |
Return upper triangular factor
Definition at line 1411 of file tnt_linalg.h.
int TNT::Linear_Algebra::LU< Real >::isNonsingular | ( | ) | [inline] |
Is the matrix nonsingular?
Definition at line 1379 of file tnt_linalg.h.
Vector<Real> TNT::Linear_Algebra::LU< Real >::permute_copy | ( | const Vector< Real > & | A, | |
const Vector< int > & | piv | |||
) | [inline, private] |
Definition at line 1277 of file tnt_linalg.h.
Matrix<Real> TNT::Linear_Algebra::LU< Real >::permute_copy | ( | const Matrix< Real > & | A, | |
const Vector< int > & | piv, | |||
int | j0, | |||
int | j1 | |||
) | [inline, private] |
Definition at line 1262 of file tnt_linalg.h.
Vector<Real> TNT::Linear_Algebra::LU< Real >::solve | ( | const Vector< Real > & | 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 (Vector> of length equal to the first dimension of A. |
Definition at line 1505 of file tnt_linalg.h.
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. |
Definition at line 1455 of file tnt_linalg.h.
Matrix<Real> TNT::Linear_Algebra::LU< Real >::LU_ [private] |
Definition at line 1257 of file tnt_linalg.h.
int TNT::Linear_Algebra::LU< Real >::m [private] |
Definition at line 1258 of file tnt_linalg.h.
int TNT::Linear_Algebra::LU< Real >::n [private] |
Definition at line 1258 of file tnt_linalg.h.
Vector<int> TNT::Linear_Algebra::LU< Real >::piv [private] |
Definition at line 1259 of file tnt_linalg.h.
int TNT::Linear_Algebra::LU< Real >::pivsign [private] |
Definition at line 1258 of file tnt_linalg.h.