ROOT 6.13/01 Reference Guide |
Cholesky Decomposition class.
Decompose a symmetric, positive definite matrix A = U^T * U
where U is a upper triangular matrix
The decomposition fails if a diagonal element of fU is <= 0, the matrix is not positive negative . The matrix fU is made invalid .
fU has the same index range as A .
Definition at line 24 of file TDecompChol.h.
Public Member Functions | |
TDecompChol () | |
TDecompChol (Int_t nrows) | |
Constructor for (nrows x nrows) matrix. More... | |
TDecompChol (Int_t row_lwb, Int_t row_upb) | |
Constructor for ([row_lwb..row_upb] x [row_lwb..row_upb]) matrix. More... | |
TDecompChol (const TMatrixDSym &a, Double_t tol=0.0) | |
Constructor for symmetric matrix A . Matrix should be positive definite. More... | |
TDecompChol (const TMatrixD &a, Double_t tol=0.0) | |
Constructor for general matrix A . Matrix should be symmetric positive definite. More... | |
TDecompChol (const TDecompChol &another) | |
Copy constructor. More... | |
virtual | ~TDecompChol () |
virtual Bool_t | Decompose () |
Matrix A is decomposed in component U so that A = U^T * U If the decomposition succeeds, bit kDecomposed is set , otherwise kSingular. More... | |
virtual void | Det (Double_t &d1, Double_t &d2) |
Matrix determinant det = d1*TMath::Power(2.,d2) is square of diagProd of cholesky factor. More... | |
const TMatrixDSym | GetMatrix () |
Reconstruct the original matrix using the decomposition parts. More... | |
virtual Int_t | GetNcols () const |
virtual Int_t | GetNrows () const |
const TMatrixD & | GetU () const |
Bool_t | Invert (TMatrixDSym &inv) |
For a symmetric matrix A(m,m), its inverse A_inv(m,m) is returned . More... | |
TMatrixDSym | Invert (Bool_t &status) |
For a symmetric matrix A(m,m), its inverse A_inv(m,m) is returned . More... | |
TMatrixDSym | Invert () |
TDecompChol & | operator= (const TDecompChol &source) |
Assignment operator. More... | |
void | Print (Option_t *opt="") const |
Print class members . More... | |
virtual void | SetMatrix (const TMatrixDSym &a) |
Set the matrix to be decomposed, decomposition status is reset. More... | |
virtual Bool_t | Solve (TVectorD &b) |
Solve equations Ax=b assuming A has been factored by Cholesky. More... | |
virtual TVectorD | Solve (const TVectorD &b, Bool_t &ok) |
virtual Bool_t | Solve (TMatrixDColumn &b) |
Solve equations Ax=b assuming A has been factored by Cholesky. More... | |
virtual Bool_t | TransSolve (TVectorD &b) |
virtual TVectorD | TransSolve (const TVectorD &b, Bool_t &ok) |
virtual Bool_t | TransSolve (TMatrixDColumn &b) |
Public Member Functions inherited from TDecompBase | |
TDecompBase () | |
Default constructor. More... | |
TDecompBase (const TDecompBase &another) | |
Copy constructor. More... | |
virtual | ~TDecompBase () |
virtual Double_t | Condition () |
Matrix condition number. More... | |
Int_t | GetColLwb () const |
Double_t | GetCondition () const |
Double_t | GetDet1 () const |
Double_t | GetDet2 () const |
Int_t | GetRowLwb () const |
Double_t | GetTol () const |
virtual Bool_t | MultiSolve (TMatrixD &B) |
Solve set of equations with RHS in columns of B. More... | |
TDecompBase & | operator= (const TDecompBase &source) |
Assignment operator. More... | |
void | Print (Option_t *opt="") const |
Print class members. More... | |
Double_t | SetTol (Double_t tol) |
Protected Member Functions | |
virtual const TMatrixDBase & | GetDecompMatrix () const |
Protected Member Functions inherited from TDecompBase | |
Int_t | Hager (Double_t &est, Int_t iter=5) |
void | ResetStatus () |
Protected Attributes | |
TMatrixD | fU |
Protected Attributes inherited from TDecompBase | |
Int_t | fColLwb |
Double_t | fCondition |
Double_t | fDet1 |
Double_t | fDet2 |
Int_t | fRowLwb |
Double_t | fTol |
Additional Inherited Members | |
Protected Types inherited from TDecompBase | |
enum | { kWorkMax = 100 } |
enum | EMatrixDecompStat { kInit = BIT(14), kPatternSet = BIT(15), kValuesSet = BIT(16), kMatrixSet = BIT(17), kDecomposed = BIT(18), kDetermined = BIT(19), kCondition = BIT(20), kSingular = BIT(21) } |
Static Protected Member Functions inherited from TDecompBase | |
static void | DiagProd (const TVectorD &diag, Double_t tol, Double_t &d1, Double_t &d2) |
#include <TDecompChol.h>
|
inline |
Definition at line 34 of file TDecompChol.h.
|
explicit |
Constructor for (nrows x nrows) matrix.
Definition at line 35 of file TDecompChol.cxx.
TDecompChol::TDecompChol | ( | Int_t | row_lwb, |
Int_t | row_upb | ||
) |
Constructor for ([row_lwb..row_upb] x [row_lwb..row_upb]) matrix.
Definition at line 43 of file TDecompChol.cxx.
TDecompChol::TDecompChol | ( | const TMatrixDSym & | a, |
Double_t | tol = 0.0 |
||
) |
Constructor for symmetric matrix A . Matrix should be positive definite.
Definition at line 54 of file TDecompChol.cxx.
TDecompChol::TDecompChol | ( | const TMatrixD & | a, |
Double_t | tol = 0.0 |
||
) |
Constructor for general matrix A . Matrix should be symmetric positive definite.
Definition at line 73 of file TDecompChol.cxx.
TDecompChol::TDecompChol | ( | const TDecompChol & | another | ) |
Copy constructor.
Definition at line 97 of file TDecompChol.cxx.
|
inlinevirtual |
Definition at line 40 of file TDecompChol.h.
|
virtual |
Matrix A is decomposed in component U so that A = U^T * U If the decomposition succeeds, bit kDecomposed is set , otherwise kSingular.
Implements TDecompBase.
Definition at line 106 of file TDecompChol.cxx.
|
virtual |
Matrix determinant det = d1*TMath::Power(2.,d2) is square of diagProd of cholesky factor.
Reimplemented from TDecompBase.
Definition at line 323 of file TDecompChol.cxx.
|
inlineprotectedvirtual |
Implements TDecompBase.
Definition at line 30 of file TDecompChol.h.
const TMatrixDSym TDecompChol::GetMatrix | ( | ) |
Reconstruct the original matrix using the decomposition parts.
Definition at line 160 of file TDecompChol.cxx.
|
inlinevirtual |
Implements TDecompBase.
Definition at line 44 of file TDecompChol.h.
|
inlinevirtual |
Implements TDecompBase.
Definition at line 43 of file TDecompChol.h.
|
inline |
Definition at line 45 of file TDecompChol.h.
Bool_t TDecompChol::Invert | ( | TMatrixDSym & | inv | ) |
For a symmetric matrix A(m,m), its inverse A_inv(m,m) is returned .
Definition at line 341 of file TDecompChol.cxx.
TMatrixDSym TDecompChol::Invert | ( | Bool_t & | status | ) |
For a symmetric matrix A(m,m), its inverse A_inv(m,m) is returned .
Definition at line 364 of file TDecompChol.cxx.
|
inline |
Definition at line 60 of file TDecompChol.h.
TDecompChol & TDecompChol::operator= | ( | const TDecompChol & | source | ) |
Assignment operator.
Definition at line 388 of file TDecompChol.cxx.
void TDecompChol::Print | ( | Option_t * | opt = "" | ) | const |
Print class members .
Definition at line 379 of file TDecompChol.cxx.
|
virtual |
Set the matrix to be decomposed, decomposition status is reset.
Definition at line 179 of file TDecompChol.cxx.
|
virtual |
Solve equations Ax=b assuming A has been factored by Cholesky.
The factor U is assumed to be in upper triang of fU. fTol is used to determine if diagonal element is zero. The solution is returned in b.
Implements TDecompBase.
Definition at line 203 of file TDecompChol.cxx.
Implements TDecompBase.
Definition at line 51 of file TDecompChol.h.
|
virtual |
Solve equations Ax=b assuming A has been factored by Cholesky.
The factor U is assumed to be in upper triang of fU. fTol is used to determine if diagonal element is zero. The solution is returned in b.
Implements TDecompBase.
Definition at line 261 of file TDecompChol.cxx.
|
inlinevirtual |
Implements TDecompBase.
Definition at line 53 of file TDecompChol.h.
Implements TDecompBase.
Definition at line 54 of file TDecompChol.h.
|
inlinevirtual |
Implements TDecompBase.
Definition at line 55 of file TDecompChol.h.
|
protected |
Definition at line 28 of file TDecompChol.h.