#include <jama_cholesky.h>
Public Member Functions | |
Cholesky () | |
Cholesky (const Array2D< Real > &A) | |
Array2D< Real > | getL () const |
Array1D< Real > | solve (const Array1D< Real > &B) |
Array2D< Real > | solve (const Array2D< Real > &B) |
int | is_spd () const |
Private Attributes | |
Array2D< Real > | L_ |
int | isspd |
Typical usage looks like:
Array2D<double> A(n,n); Array2D<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).
Definition at line 47 of file jama_cholesky.h.
JAMA::Cholesky< Real >::Cholesky | ( | ) | [inline] |
Definition at line 64 of file jama_cholesky.h.
JAMA::Cholesky< Real >::Cholesky | ( | const Array2D< 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.
Definition at line 92 of file jama_cholesky.h.
Array2D< Real > JAMA::Cholesky< Real >::getL | ( | ) | const [inline] |
Definition at line 80 of file jama_cholesky.h.
int JAMA::Cholesky< Real >::is_spd | ( | ) | const [inline] |
Definition at line 71 of file jama_cholesky.h.
Array2D< Real > JAMA::Cholesky< Real >::solve | ( | const Array2D< 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. |
Definition at line 188 of file jama_cholesky.h.
Array1D< Real > JAMA::Cholesky< Real >::solve | ( | const Array1D< 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. |
Definition at line 146 of file jama_cholesky.h.
int JAMA::Cholesky< Real >::isspd [private] |
Definition at line 50 of file jama_cholesky.h.
Array2D<Real> JAMA::Cholesky< Real >::L_ [private] |
Definition at line 49 of file jama_cholesky.h.