#include <tnt_linalg.h>
Public Member Functions | |
Cholesky (const Matrix< Real > &A) | |
Matrix< Real > | getL () const |
Vector< Real > | solve (const Vector< Real > &B) |
Matrix< Real > | solve (const Matrix< Real > &B) |
int | is_spd () const |
Typical usage looks like:
Matrix<double> A(n,n); Matrix<double> L;
...
Cholesky<double> chol(A);
if (chol.is_spd()) L = chol.getL();
else cout << "factorization was not complete.\n";
(Adapted from JAMA, a Java Matrix Library, developed by jointly by the Mathworks and NIST; see http://math.nist.gov/javanumerics/jama).
TNT::Linear_Algebra::Cholesky< Real >::Cholesky | ( | const Matrix< Real > & | A | ) | [inline] |
Constructs a lower triangular matrix L, such that L*L'= A. If A is not symmetric positive-definite (SPD), only a partial factorization is performed. If is_spd() evalutate true (1) then the factorizaiton was successful.
Matrix< Real > TNT::Linear_Algebra::Cholesky< Real >::getL | ( | ) | const [inline] |
int TNT::Linear_Algebra::Cholesky< Real >::is_spd | ( | ) | const [inline] |
Matrix< Real > TNT::Linear_Algebra::Cholesky< Real >::solve | ( | const Matrix< Real > & | B | ) | [inline] |
Solve a linear system A*X = B, using the previously computed cholesky factorization of A: L*L'.
B | A Matrix with as many rows as A and any number of columns. |
Vector< Real > TNT::Linear_Algebra::Cholesky< Real >::solve | ( | const Vector< Real > & | b | ) | [inline] |
Solve a linear system A*x = b, using the previously computed cholesky factorization of A: L*L'.
b | matrix with as many rows as A and any number of columns. |