ROOT logo
+
class TDecompSparse
-
library: libMatrix
#include "TDecompSparse.h"
Display options:
Show inherited
Show non-public
ROOT » MATH » MATRIX » TDecompSparse

class TDecompSparse: public TDecompBase

Sparse Symmetric Decomposition class

Solve a sparse symmetric system of linear equations using a method
based on Gaussian elimination as discussed in Duff and Reid,
ACM Trans. Math. Software 9 (1983), 302-325.


Function Members (Methods)

public:
TDecompSparse()
TDecompSparse(const TDecompSparse& another)
TDecompSparse(const TMatrixDSparse& a, Int_t verbose)
TDecompSparse(Int_t nRows, Int_t nr_nonZeros, Int_t verbose)
TDecompSparse(Int_t row_lwb, Int_t row_upb, Int_t nr_nonZeros, Int_t verbose)
virtual~TDecompSparse()
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&, Double_t&)
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
Int_tTDecompBase::GetRowLwb() const
virtual const char*TObject::GetTitle() const
Double_tTDecompBase::GetTol() const
virtual UInt_tTObject::GetUniqueID() const
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
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
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static 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)
TDecompSparse&operator=(const TDecompSparse& 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 TMatrixDSparse& a)
static voidTObject::SetObjectStat(Bool_t stat)
Double_tTDecompBase::SetTol(Double_t newTol)
virtual voidTObject::SetUniqueID(UInt_t uid)
voidSetVerbose(Int_t v)
virtual voidShowMembers(TMemberInspector& insp)
virtual Bool_tSolve(TVectorD& b)
virtual Bool_tSolve(TMatrixDColumn&)
virtual TVectorDSolve(const TVectorD& b, Bool_t& ok)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual Bool_tTransSolve(TVectorD& b)
virtual Bool_tTransSolve(TMatrixDColumn&)
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 voidCopyUpperTriang(const TMatrixDSparse& a, Double_t* b)
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
Int_tErrorFlag()
static voidFactor(const Int_t n, const Int_t nz, TArrayI& Airn, TArrayI& Aicn, TArrayD& Aa, TArrayI& Aiw, TArrayI& Aikeep, const Int_t nsteps, Int_t& maxfrt, TArrayI& Aiw1, Int_t* icntl, Double_t* cntl, Int_t* info)
static voidFactor_sub1(const Int_t n, const Int_t nz, Int_t& nz1, Double_t* a, const Int_t la, Int_t* irn, Int_t* icn, Int_t* iw, const Int_t liw, Int_t* perm, Int_t* iw2, Int_t* icntl, Int_t* info)
static voidFactor_sub2(const Int_t n, const Int_t nz, Double_t* a, const Int_t la, Int_t* iw, const Int_t liw, Int_t* perm, Int_t* nstk, const Int_t nsteps, Int_t& maxfrt, Int_t* nelim, Int_t* iw2, Int_t* icntl, Double_t* cntl, Int_t* info)
static voidFactor_sub3(Double_t* a, Int_t* iw, Int_t& j1, Int_t& j2, const Int_t itop, const Int_t ireal, Int_t& ncmpbr, Int_t& ncmpbi)
virtual const TMatrixDBase&GetDecompMatrix() const
Double_tGetThresholdPivoting()
Double_tGetTreatAsZero()
Int_tTDecompBase::Hager(Double_t& est, Int_t iter = 5)
static Int_tIDiag(Int_t ix, Int_t iy)
Int_tIError()
voidInitParam()
static voidInitPivot(const Int_t n, const Int_t nz, TArrayI& Airn, TArrayI& Aicn, TArrayI& Aiw, TArrayI& Aikeep, TArrayI& Aiw1, Int_t& nsteps, const Int_t iflag, Int_t* icntl, Double_t* cntl, Int_t* info, Double_t& ops)
static voidInitPivot_sub1(const Int_t n, const Int_t nz, Int_t* irn, Int_t* icn, Int_t* iw, Int_t* ipe, Int_t* iq, Int_t* flag, Int_t& iwfr, Int_t* icntl, Int_t* info)
static voidInitPivot_sub2(const Int_t n, Int_t* ipe, Int_t* iw, const Int_t lw, Int_t& iwfr, Int_t* nv, Int_t* nxt, Int_t* lst, Int_t* ipd, Int_t* flag, const Int_t iovflo, Int_t& ncmpa, const Double_t fratio)
static voidInitPivot_sub2a(const Int_t n, Int_t* ipe, Int_t* iw, const Int_t lw, Int_t& iwfr, Int_t& ncmpa)
static voidInitPivot_sub3(const Int_t n, const Int_t nz, Int_t* irn, Int_t* icn, Int_t* perm, Int_t* iw, Int_t* ipe, Int_t* iq, Int_t* flag, Int_t& iwfr, Int_t* icntl, Int_t* info)
static voidInitPivot_sub4(const Int_t n, Int_t* ipe, Int_t* iw, const Int_t lw, Int_t& iwfr, Int_t* ips, Int_t* ipv, Int_t* nv, Int_t* flag, Int_t& ncmpa)
static voidInitPivot_sub5(const Int_t n, Int_t* ipe, Int_t* nv, Int_t* ips, Int_t* ne, Int_t* na, Int_t* nd, Int_t& nsteps, const Int_t nemin)
static voidInitPivot_sub6(const Int_t n, const Int_t nz, Int_t* irn, Int_t* icn, Int_t* perm, Int_t* na, Int_t* ne, Int_t* nd, const Int_t nsteps, Int_t* lstki, Int_t* lstkr, Int_t* iw, Int_t* info, Double_t& ops)
voidTObject::MakeZombie()
Int_tMinIntWorkspace()
Int_tMinRealWorkspace()
static Int_tNonZerosUpperTriang(const TMatrixDSparse& a)
voidTDecompBase::ResetStatus()
voidSetThresholdPivoting(Double_t piv)
voidSetTreatAsZero(Double_t tol)
static voidSolve(const Int_t n, TArrayD& Aa, TArrayI& Aiw, TArrayD& Aw, const Int_t maxfrt, TVectorD& b, TArrayI& Aiw1, const Int_t nsteps, Int_t* icntl, Int_t* info)
static voidSolve_sub1(const Int_t n, Double_t* a, Int_t* iw, Double_t* w, Double_t* rhs, Int_t* iw2, const Int_t nblk, Int_t& latop, Int_t* icntl)
static voidSolve_sub2(const Int_t n, Double_t* a, Int_t* iw, Double_t* w, Double_t* rhs, Int_t* iw2, const Int_t nblk, const Int_t latop, Int_t* icntl)

Data Members

public:
enum TDecompBase::EMatrixDecompStat { kInit
kPatternSet
kValuesSet
kMatrixSet
kDecomposed
kDetermined
kCondition
kSingular
};
enum TDecompBase::[unnamed] { kWorkMax
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
TMatrixDSparsefAoriginal matrix; needed for the iterative solving procedure
Double_tfCntl[6]float control numbers
TArrayIfColFact
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
TArrayDfFactsize of fFact array; may be increased during the numerical factorization
Double_tfIPessimismamounts by which to increase allocated factorization space when
Int_tfIcntl[31]integer control numbers
TArrayIfIkeeppivot sequence and temporary storage information
Int_tfInfo[21]array used for communication between programs
TArrayIfIw
TArrayIfIw1
TArrayIfIw2
Int_tfMaxfrt
Int_tfNnonZeros
Int_tfNrows
Int_tfNsteps
Double_tfPrecisionprecision we demand from the linear system solver. If it isn't
Double_tfRPessimisminadequate space is detected. fIPessimism is for array "fIw",
TArrayIfRowFact
Int_tTDecompBase::fRowLwbRow lower bound of decomposed matrix
Double_tTDecompBase::fTolsqrt(epsilon); epsilon is smallest number number so that 1+epsilon > 1
Int_tfVerbose
TArrayDfWtemporary storage for the factorization

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TDecompSparse()
 Default constructor
TDecompSparse(Int_t nRows, Int_t nr_nonZeros, Int_t verbose)
 Constructor for a matrix with nrows and unspecified number of columns .
 nr_nonZeros is the total number of non-zero entries in the matrix .
TDecompSparse(Int_t row_lwb, Int_t row_upb, Int_t nr_nonZeros, Int_t verbose)
 Constructor for a matrix with row range, [row_lwb..row_upb] and unspecified column
 range . nr_nonZeros is the total number of non-zero entries in the matrix .
TDecompSparse(const TMatrixDSparse& a, Int_t verbose)
 Constructor for matrix A .
TDecompSparse(const TDecompSparse& another)
 Copy constructor
Int_t NonZerosUpperTriang(const TMatrixDSparse& a)
 Static function, returning the number of non-zero entries in the upper triangular matrix .
void CopyUpperTriang(const TMatrixDSparse& a, Double_t* b)
 Static function, copying the non-zero entries in the upper triangle to
 array b . User should allocate enough memory for array b .
void SetMatrix(const TMatrixDSparse& a)
 Set matrix to be decomposed .
Bool_t Decompose()
 Decomposition engine .
 If the decomposition succeeds, bit kDecomposed is set .
Bool_t Solve(TVectorD& b)
 Solve Ax=b . Solution returned in b.
void InitParam()
 initializing control parameters
void InitPivot(const Int_t n, const Int_t nz, TArrayI& Airn, TArrayI& Aicn, TArrayI& Aiw, TArrayI& Aikeep, TArrayI& Aiw1, Int_t& nsteps, const Int_t iflag, Int_t* icntl, Double_t* cntl, Int_t* info, Double_t& ops)
 Setup Pivoting variables
void Factor(const Int_t n, const Int_t nz, TArrayI& Airn, TArrayI& Aicn, TArrayD& Aa, TArrayI& Aiw, TArrayI& Aikeep, const Int_t nsteps, Int_t& maxfrt, TArrayI& Aiw1, Int_t* icntl, Double_t* cntl, Int_t* info)
 Factorization routine, the workhorse for the decompostion step
void Solve(const Int_t n, TArrayD& Aa, TArrayI& Aiw, TArrayD& Aw, const Int_t maxfrt, TVectorD& b, TArrayI& Aiw1, const Int_t nsteps, Int_t* icntl, Int_t* info)
 Main routine for solving Ax=b
void InitPivot_sub1(const Int_t n, const Int_t nz, Int_t* irn, Int_t* icn, Int_t* iw, Int_t* ipe, Int_t* iq, Int_t* flag, Int_t& iwfr, Int_t* icntl, Int_t* info)
 Help routine for pivoting setup
void InitPivot_sub2(const Int_t n, Int_t* ipe, Int_t* iw, const Int_t lw, Int_t& iwfr, Int_t* nv, Int_t* nxt, Int_t* lst, Int_t* ipd, Int_t* flag, const Int_t iovflo, Int_t& ncmpa, const Double_t fratio)
 Help routine for pivoting setup
void InitPivot_sub2a(const Int_t n, Int_t* ipe, Int_t* iw, const Int_t lw, Int_t& iwfr, Int_t& ncmpa)
 Help routine for pivoting setup
void InitPivot_sub3(const Int_t n, const Int_t nz, Int_t* irn, Int_t* icn, Int_t* perm, Int_t* iw, Int_t* ipe, Int_t* iq, Int_t* flag, Int_t& iwfr, Int_t* icntl, Int_t* info)
 Help routine for pivoting setup
void InitPivot_sub4(const Int_t n, Int_t* ipe, Int_t* iw, const Int_t lw, Int_t& iwfr, Int_t* ips, Int_t* ipv, Int_t* nv, Int_t* flag, Int_t& ncmpa)
 Help routine for pivoting setup
void InitPivot_sub5(const Int_t n, Int_t* ipe, Int_t* nv, Int_t* ips, Int_t* ne, Int_t* na, Int_t* nd, Int_t& nsteps, const Int_t nemin)
 Help routine for pivoting setup
void InitPivot_sub6(const Int_t n, const Int_t nz, Int_t* irn, Int_t* icn, Int_t* perm, Int_t* na, Int_t* ne, Int_t* nd, const Int_t nsteps, Int_t* lstki, Int_t* lstkr, Int_t* iw, Int_t* info, Double_t& ops)
 Help routine for pivoting setup
void Factor_sub1(const Int_t n, const Int_t nz, Int_t& nz1, Double_t* a, const Int_t la, Int_t* irn, Int_t* icn, Int_t* iw, const Int_t liw, Int_t* perm, Int_t* iw2, Int_t* icntl, Int_t* info)
 Help routine for factorization
void Factor_sub2(const Int_t n, const Int_t nz, Double_t* a, const Int_t la, Int_t* iw, const Int_t liw, Int_t* perm, Int_t* nstk, const Int_t nsteps, Int_t& maxfrt, Int_t* nelim, Int_t* iw2, Int_t* icntl, Double_t* cntl, Int_t* info)
 Help routine for factorization
void Factor_sub3(Double_t* a, Int_t* iw, Int_t& j1, Int_t& j2, const Int_t itop, const Int_t ireal, Int_t& ncmpbr, Int_t& ncmpbi)
 Help routine for factorization
void Solve_sub1(const Int_t n, Double_t* a, Int_t* iw, Double_t* w, Double_t* rhs, Int_t* iw2, const Int_t nblk, Int_t& latop, Int_t* icntl)
 Help routine for solving
void Solve_sub2(const Int_t n, Double_t* a, Int_t* iw, Double_t* w, Double_t* rhs, Int_t* iw2, const Int_t nblk, const Int_t latop, Int_t* icntl)
 Help routine for solving
void Print(Option_t* opt = "") const
 Print class members
TDecompSparse & operator=(const TDecompSparse& source)
 Assignment operator
void Solve(const Int_t n, TArrayD& Aa, TArrayI& Aiw, TArrayD& Aw, const Int_t maxfrt, TVectorD& b, TArrayI& Aiw1, const Int_t nsteps, Int_t* icntl, Int_t* info)
Int_t IDiag(Int_t ix, Int_t iy)
{ return ((iy-1)*(2*ix-iy+2))/2; }
Int_t IError()
{ return fInfo[2]; }
Int_t MinRealWorkspace()
{ return fInfo[5]; }
Int_t MinIntWorkspace()
{ return fInfo[6]; }
Int_t ErrorFlag()
{ return fInfo[1]; }
Double_t GetThresholdPivoting()
 Takes values in the range [0,1]. Larger values enforce greater stability in
 the factorization as they insist on larger pivots. Smaller values preserve
 sparsity at the cost of using smaller pivots.
{ return fCntl[1]; }
Double_t GetTreatAsZero()
{ return fCntl[3]; }
void SetThresholdPivoting(Double_t piv)
 The factorization will not accept a pivot whose absolute value is less than fCntl[3] as
 a 1x1 pivot or as the off-diagonal in a 2x2 pivot.
{ fCntl[1] = piv; }
void SetTreatAsZero(Double_t tol)
{ fCntl[3] = tol; }
const TMatrixDBase & GetDecompMatrix() const
{ MayNotUse("GetDecompMatrix()"); return fA; }
virtual ~TDecompSparse()
{}
void SetVerbose(Int_t v)
Int_t GetNrows() const
{ return fA.GetNrows(); }
Int_t GetNcols() const
{ return fA.GetNcols(); }
Bool_t Solve(TVectorD& b)
Bool_t TransSolve(TVectorD& b)
{ return Solve(b); }
TVectorD TransSolve(const TVectorD& b, Bool_t& ok)
{ TVectorD x = b; ok = Solve(x); return x; }
Bool_t TransSolve(TMatrixDColumn& )
{ MayNotUse("TransSolve(TMatrixDColumn &)"); return kFALSE; }
void Det(Double_t& , Double_t& )
{ MayNotUse("Det(Double_t&,Double_t&)"); }