00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TDecompQRH
00013 #define ROOT_TDecompQRH
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef ROOT_TDecompBase
00022 #include "TDecompBase.h"
00023 #endif
00024
00025 class TDecompQRH : public TDecompBase
00026 {
00027 protected :
00028
00029
00030 TMatrixD fQ;
00031 TMatrixD fR;
00032 TVectorD fUp;
00033 TVectorD fW;
00034
00035 static Bool_t QRH(TMatrixD &q,TVectorD &diagR,TVectorD &up,TVectorD &w,Double_t tol);
00036
00037 virtual const TMatrixDBase &GetDecompMatrix() const { return fR; }
00038
00039 public :
00040
00041 enum {kWorkMax = 100};
00042
00043 TDecompQRH() {}
00044 TDecompQRH(Int_t nrows,Int_t ncols);
00045 TDecompQRH(Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb);
00046 TDecompQRH(const TMatrixD &m,Double_t tol = 0.0);
00047 TDecompQRH(const TDecompQRH &another);
00048 virtual ~TDecompQRH() {}
00049
00050 virtual Int_t GetNrows () const { return fQ.GetNrows(); }
00051 virtual Int_t GetNcols () const { return fQ.GetNcols(); }
00052 virtual const TMatrixD &GetQ () { if ( !TestBit(kDecomposed) ) Decompose();
00053 return fQ; }
00054 virtual const TMatrixD &GetR () { if ( !TestBit(kDecomposed) ) Decompose();
00055 return fR; }
00056 virtual const TVectorD &GetUp () { if ( !TestBit(kDecomposed) ) Decompose();
00057 return fUp; }
00058 virtual const TVectorD &GetW () { if ( !TestBit(kDecomposed) ) Decompose();
00059 return fW; }
00060
00061 virtual void SetMatrix(const TMatrixD &a);
00062
00063 virtual Bool_t Decompose ();
00064 virtual Bool_t Solve ( TVectorD &b);
00065 virtual TVectorD Solve (const TVectorD& b,Bool_t &ok) { TVectorD x = b; ok = Solve(x); return x; }
00066 virtual Bool_t Solve ( TMatrixDColumn &b);
00067 virtual Bool_t TransSolve ( TVectorD &b);
00068 virtual TVectorD TransSolve (const TVectorD& b,Bool_t &ok) { TVectorD x = b; ok = TransSolve(x); return x; }
00069 virtual Bool_t TransSolve ( TMatrixDColumn &b);
00070 virtual void Det (Double_t &d1,Double_t &d2);
00071
00072 Bool_t Invert (TMatrixD &inv);
00073 TMatrixD Invert (Bool_t &status);
00074 TMatrixD Invert () { Bool_t status; return Invert(status); }
00075
00076 void Print(Option_t *opt ="") const;
00077
00078 TDecompQRH &operator= (const TDecompQRH &source);
00079
00080 ClassDef(TDecompQRH,1)
00081 };
00082
00083 #endif