Logo ROOT   6.13/01
Reference Guide
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TDecompChol Class Reference

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 TMatrixDGetU () 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 ()
 
TDecompCholoperator= (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...
 
TDecompBaseoperator= (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 TMatrixDBaseGetDecompMatrix () 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>

Inheritance diagram for TDecompChol:
[legend]

Constructor & Destructor Documentation

◆ TDecompChol() [1/6]

TDecompChol::TDecompChol ( )
inline

Definition at line 34 of file TDecompChol.h.

◆ TDecompChol() [2/6]

TDecompChol::TDecompChol ( Int_t  nrows)
explicit

Constructor for (nrows x nrows) matrix.

Definition at line 35 of file TDecompChol.cxx.

◆ TDecompChol() [3/6]

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() [4/6]

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() [5/6]

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() [6/6]

TDecompChol::TDecompChol ( const TDecompChol another)

Copy constructor.

Definition at line 97 of file TDecompChol.cxx.

◆ ~TDecompChol()

virtual TDecompChol::~TDecompChol ( )
inlinevirtual

Definition at line 40 of file TDecompChol.h.

Member Function Documentation

◆ Decompose()

Bool_t TDecompChol::Decompose ( )
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.

◆ Det()

void TDecompChol::Det ( Double_t &  d1,
Double_t &  d2 
)
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.

◆ GetDecompMatrix()

virtual const TMatrixDBase& TDecompChol::GetDecompMatrix ( ) const
inlineprotectedvirtual

Implements TDecompBase.

Definition at line 30 of file TDecompChol.h.

◆ GetMatrix()

const TMatrixDSym TDecompChol::GetMatrix ( )

Reconstruct the original matrix using the decomposition parts.

Definition at line 160 of file TDecompChol.cxx.

◆ GetNcols()

virtual Int_t TDecompChol::GetNcols ( ) const
inlinevirtual

Implements TDecompBase.

Definition at line 44 of file TDecompChol.h.

◆ GetNrows()

virtual Int_t TDecompChol::GetNrows ( ) const
inlinevirtual

Implements TDecompBase.

Definition at line 43 of file TDecompChol.h.

◆ GetU()

const TMatrixD& TDecompChol::GetU ( ) const
inline

Definition at line 45 of file TDecompChol.h.

◆ Invert() [1/3]

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.

◆ Invert() [2/3]

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.

◆ Invert() [3/3]

TMatrixDSym TDecompChol::Invert ( )
inline

Definition at line 60 of file TDecompChol.h.

◆ operator=()

TDecompChol & TDecompChol::operator= ( const TDecompChol source)

Assignment operator.

Definition at line 388 of file TDecompChol.cxx.

◆ Print()

void TDecompChol::Print ( Option_t *  opt = "") const

Print class members .

Definition at line 379 of file TDecompChol.cxx.

◆ SetMatrix()

void TDecompChol::SetMatrix ( const TMatrixDSym a)
virtual

Set the matrix to be decomposed, decomposition status is reset.

Definition at line 179 of file TDecompChol.cxx.

◆ Solve() [1/3]

Bool_t TDecompChol::Solve ( TVectorD b)
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.

◆ Solve() [2/3]

virtual TVectorD TDecompChol::Solve ( const TVectorD b,
Bool_t &  ok 
)
inlinevirtual

Implements TDecompBase.

Definition at line 51 of file TDecompChol.h.

◆ Solve() [3/3]

Bool_t TDecompChol::Solve ( TMatrixDColumn cb)
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.

◆ TransSolve() [1/3]

virtual Bool_t TDecompChol::TransSolve ( TVectorD b)
inlinevirtual

Implements TDecompBase.

Definition at line 53 of file TDecompChol.h.

◆ TransSolve() [2/3]

virtual TVectorD TDecompChol::TransSolve ( const TVectorD b,
Bool_t &  ok 
)
inlinevirtual

Implements TDecompBase.

Definition at line 54 of file TDecompChol.h.

◆ TransSolve() [3/3]

virtual Bool_t TDecompChol::TransSolve ( TMatrixDColumn b)
inlinevirtual

Implements TDecompBase.

Definition at line 55 of file TDecompChol.h.

Member Data Documentation

◆ fU

TMatrixD TDecompChol::fU
protected

Definition at line 28 of file TDecompChol.h.

Libraries for TDecompChol:
[legend]

The documentation for this class was generated from the following files: