12 #ifndef ROOT_TDecompBase
13 #define ROOT_TDecompBase
33 class TDecompBase :
public TObject
43 void ResetStatus() {
for (Int_t i = 14; i < 22; i++) ResetBit(BIT(i)); }
44 Int_t Hager (Double_t& est,Int_t iter=5);
45 static void DiagProd (
const TVectorD &diag,Double_t tol,Double_t &d1,Double_t &d2);
47 virtual const TMatrixDBase &GetDecompMatrix()
const = 0;
49 enum EMatrixDecompStat {
51 kPatternSet = BIT(15),
54 kDecomposed = BIT(18),
55 kDetermined = BIT(19),
60 enum {kWorkMax = 100};
64 TDecompBase(
const TDecompBase &another);
65 virtual ~TDecompBase() {};
67 inline Double_t GetTol ()
const {
return fTol; }
68 inline Double_t GetDet1 ()
const {
return fDet1; }
69 inline Double_t GetDet2 ()
const {
return fDet2; }
70 inline Double_t GetCondition ()
const {
return fCondition; }
71 virtual Int_t GetNrows ()
const = 0;
72 virtual Int_t GetNcols ()
const = 0;
73 Int_t GetRowLwb ()
const {
return fRowLwb; }
74 Int_t GetColLwb ()
const {
return fColLwb; }
75 inline Double_t SetTol (Double_t tol);
77 virtual Double_t Condition ();
78 virtual void Det (Double_t &d1,Double_t &d2);
79 virtual Bool_t Decompose () = 0;
80 virtual Bool_t Solve ( TVectorD &b) = 0;
81 virtual TVectorD Solve (
const TVectorD& b,Bool_t &ok) = 0;
82 virtual Bool_t Solve ( TMatrixDColumn& b) = 0;
83 virtual Bool_t TransSolve ( TVectorD &b) = 0;
84 virtual TVectorD TransSolve (
const TVectorD &b,Bool_t &ok) = 0;
85 virtual Bool_t TransSolve ( TMatrixDColumn& b) = 0;
87 virtual Bool_t MultiSolve (TMatrixD &B);
89 void Print(Option_t *opt=
"")
const;
91 TDecompBase &operator= (
const TDecompBase &source);
93 ClassDef(TDecompBase,2)
96 Double_t TDecompBase::SetTol(Double_t newTol)
98 const Double_t oldTol = fTol;
104 Bool_t DefHouseHolder (
const TVectorD &vc,Int_t lp,Int_t l,Double_t &up,Double_t &b,Double_t tol=0.0);
105 void ApplyHouseHolder(
const TVectorD &vc,Double_t up,Double_t b,Int_t lp,Int_t l,TMatrixDRow &cr);
106 void ApplyHouseHolder(
const TVectorD &vc,Double_t up,Double_t b,Int_t lp,Int_t l,TMatrixDColumn &cc);
107 void ApplyHouseHolder(
const TVectorD &vc,Double_t up,Double_t b,Int_t lp,Int_t l,TVectorD &cv);
108 void DefGivens ( Double_t v1,Double_t v2,Double_t &c,Double_t &s);
109 void DefAplGivens ( Double_t &v1,Double_t &v2,Double_t &c,Double_t &s);
110 void ApplyGivens ( Double_t &z1,Double_t &z2,Double_t c,Double_t s);