ROOT » MATH » MATRIX » TDecompQRH

class TDecompQRH: public TDecompBase


QR Decomposition class

Decompose  a general (m x n) matrix A into A = fQ fR H   where

fQ : (m x n) - orthogonal matrix
fR : (n x n) - upper triangular matrix
H  : HouseHolder matrix which is stored through
fUp: (n) - vector with Householder up's
fW : (n) - vector with Householder beta's

If row/column index of A starts at (rowLwb,colLwb) then
the decomposed matrices start from :
fQ  : (rowLwb,0)
fR  : (0,colLwb)
and the decomposed vectors start from :
fUp : (0)
fW  : (0)

Errors arise from formation of reflectors i.e. singularity .
Note it attempts to handle the cases where the nRow <= nCol .


Function Members (Methods)

public:
virtual~TDecompQRH()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual Double_tTDecompBase::Condition()
virtual voidTObject::Copy(TObject& object) const
virtual Bool_tDecompose()
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual voidDet(Double_t& d1, Double_t& d2)
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
Int_tTDecompBase::GetColLwb() const
Double_tTDecompBase::GetCondition() const
Double_tTDecompBase::GetDet1() const
Double_tTDecompBase::GetDet2() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
virtual const char*TObject::GetName() const
virtual Int_tGetNcols() const
virtual Int_tGetNrows() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual const TMatrixD&GetQ()
virtual const TMatrixD&GetR()
Int_tTDecompBase::GetRowLwb() const
virtual const char*TObject::GetTitle() const
Double_tTDecompBase::GetTol() const
virtual UInt_tTObject::GetUniqueID() const
virtual const TVectorD&GetUp()
virtual const TVectorD&GetW()
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
TMatrixDInvert()
Bool_tInvert(TMatrixD& inv)
TMatrixDInvert(Bool_t& status)
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTDecompBase::MultiSolve(TMatrixD& B)
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
voidTObject::operator delete(void* ptr)
voidTObject::operator delete(void* ptr, void* vp)
voidTObject::operator delete[](void* ptr)
voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TDecompQRH&operator=(const TDecompQRH& source)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(Option_t* opt = "") constMENU
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidSetMatrix(const TMatrixD& a)
static voidTObject::SetObjectStat(Bool_t stat)
Double_tTDecompBase::SetTol(Double_t tol)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp) const
virtual Bool_tSolve(TVectorD& b)
virtual Bool_tSolve(TMatrixDColumn& b)
virtual TVectorDSolve(const TVectorD& b, Bool_t& ok)
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
TDecompQRH()
TDecompQRH(const TDecompQRH& another)
TDecompQRH(Int_t nrows, Int_t ncols)
TDecompQRH(const TMatrixD& m, Double_t tol = 0.)
TDecompQRH(Int_t row_lwb, Int_t row_upb, Int_t col_lwb, Int_t col_upb)
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual Bool_tTransSolve(TVectorD& b)
virtual Bool_tTransSolve(TMatrixDColumn& b)
virtual TVectorDTransSolve(const TVectorD& b, Bool_t& ok)
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
static voidTDecompBase::DiagProd(const TVectorD& diag, Double_t tol, Double_t& d1, Double_t& d2)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
virtual const TMatrixDBase&GetDecompMatrix() const
Int_tTDecompBase::Hager(Double_t& est, Int_t iter = 5)
voidTObject::MakeZombie()
static Bool_tQRH(TMatrixD& q, TVectorD& diagR, TVectorD& up, TVectorD& w, Double_t tol)
voidTDecompBase::ResetStatus()

Data Members

public:
static TObject::(anonymous)TObject::kBitMask
static TObject::EStatusBitsTObject::kCanDelete
static TObject::EStatusBitsTObject::kCannotPick
static TObject::EStatusBitsTObject::kHasUUID
static TObject::EStatusBitsTObject::kInvalidObject
static TObject::(anonymous)TObject::kIsOnHeap
static TObject::EStatusBitsTObject::kIsReferenced
static TObject::EStatusBitsTObject::kMustCleanup
static TObject::EStatusBitsTObject::kNoContextMenu
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EStatusBitsTObject::kObjInCanvas
static TObject::(anonymous)TObject::kOverwrite
static TObject::(anonymous)TObject::kSingleKey
static TDecompQRH::(anonymous)kWorkMax
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
protected:
Int_tTDecompBase::fColLwbColumn lower bound of decomposed matrix
Double_tTDecompBase::fConditionmatrix condition number
Double_tTDecompBase::fDet1determinant mantissa
Double_tTDecompBase::fDet2determinant exponent for powers of 2
TMatrixDfQ(m x n) - orthogonal matrix
TMatrixDfR(n x n) - upper triangular matrix
Int_tTDecompBase::fRowLwbRow lower bound of decomposed matrix
Double_tTDecompBase::fTolsqrt(epsilon); epsilon is smallest number number so that 1+epsilon > 1
TVectorDfUp(n) - vector with Householder up's
TVectorDfW(n) - vector with Householder beta's
static TDecompBase::EMatrixDecompStatTDecompBase::kCondition
static TDecompBase::EMatrixDecompStatTDecompBase::kDecomposed
static TDecompBase::EMatrixDecompStatTDecompBase::kDetermined
static TDecompBase::EMatrixDecompStatTDecompBase::kInit
static TDecompBase::EMatrixDecompStatTDecompBase::kMatrixSet
static TDecompBase::EMatrixDecompStatTDecompBase::kPatternSet
static TDecompBase::EMatrixDecompStatTDecompBase::kSingular
static TDecompBase::EMatrixDecompStatTDecompBase::kValuesSet
static TDecompBase::(anonymous)TDecompBase::kWorkMax

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TDecompQRH(Int_t nrows, Int_t ncols)
 Constructor for (nrows x ncols) matrix
TDecompQRH(Int_t row_lwb, Int_t row_upb, Int_t col_lwb, Int_t col_upb)
 Constructor for ([row_lwb..row_upb] x [col_lwb..col_upb]) matrix
TDecompQRH(const TMatrixD& m, Double_t tol = 0.)
 Constructor for general matrix A .
TDecompQRH(const TDecompQRH& another)
 Copy constructor
Bool_t Decompose()
 QR decomposition of matrix a by Householder transformations,
  see Golub & Loan first edition p41 & Sec 6.2.
 First fR is returned in upper triang of fQ and diagR. fQ returned in
 'u-form' in lower triang of fQ and fW, the latter containing the
  "Householder betas".
 If the decomposition succeeds, bit kDecomposed is set , otherwise kSingular
Bool_t QRH(TMatrixD& q, TVectorD& diagR, TVectorD& up, TVectorD& w, Double_t tol)
 Decomposition function .
void SetMatrix(const TMatrixD& a)
 Set matrix to be decomposed
Bool_t Solve(TVectorD& b)
 Solve Ax=b assuming the QR form of A is stored in fR,fQ and fW, but assume b
 has *not* been transformed.  Solution returned in b.
Bool_t Solve(TMatrixDColumn& b)
 Solve Ax=b assuming the QR form of A is stored in fR,fQ and fW, but assume b
 has *not* been transformed.  Solution returned in b.
Bool_t TransSolve(TVectorD& b)
 Solve A^T x=b assuming the QR form of A is stored in fR,fQ and fW, but assume b
 has *not* been transformed.  Solution returned in b.
Bool_t TransSolve(TMatrixDColumn& b)
 Solve A^T x=b assuming the QR form of A is stored in fR,fQ and fW, but assume b
 has *not* been transformed.  Solution returned in b.
void Det(Double_t& d1, Double_t& d2)
 This routine calculates the absolute (!) value of the determinant
 |det| = d1*TMath::Power(2.,d2)
Bool_t Invert(TMatrixD& inv)
 For a matrix A(m,n), its inverse A_inv is defined as A * A_inv = A_inv * A = unit
 The user should always supply a matrix of size (m x m) !
 If m > n , only the (n x m) part of the returned (pseudo inverse) matrix
 should be used .
TMatrixD Invert(Bool_t& status)
 For a matrix A(m,n), its inverse A_inv is defined as A * A_inv = A_inv * A = unit
 (n x m) Ainv is returned .
void Print(Option_t* opt = "") const
 Print the class members
TDecompQRH & operator=(const TDecompQRH& source)
 Assignment operator
const TMatrixDBase & GetDecompMatrix() const
{ return fR; }
TDecompQRH()
{}
virtual ~TDecompQRH()
{}
Int_t GetNrows() const
{ return fQ.GetNrows(); }
Int_t GetNcols() const
{ return fQ.GetNcols(); }
const TMatrixD & GetQ()
const TMatrixD & GetR()
const TVectorD & GetUp()
const TVectorD & GetW()
Bool_t Solve(TVectorD& b)
Bool_t TransSolve(TVectorD& b)
Bool_t Invert(TMatrixD& inv)