File indexing completed on 2025-01-18 10:11:38
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TDecompQRH
0013 #define ROOT_TDecompQRH
0014
0015
0016
0017
0018
0019
0020
0021 #include "TDecompBase.h"
0022
0023 #include "Rtypes.h"
0024
0025 class TDecompQRH : public TDecompBase
0026 {
0027 protected :
0028
0029
0030 TMatrixD fQ;
0031 TMatrixD fR;
0032 TVectorD fUp;
0033 TVectorD fW;
0034
0035 static Bool_t QRH(TMatrixD &q,TVectorD &diagR,TVectorD &up,TVectorD &w,Double_t tol);
0036
0037 const TMatrixDBase &GetDecompMatrix() const override { return fR; }
0038
0039 public :
0040
0041 enum {kWorkMax = 100};
0042
0043 TDecompQRH() {}
0044 TDecompQRH(Int_t nrows,Int_t ncols);
0045 TDecompQRH(Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb);
0046 TDecompQRH(const TMatrixD &m,Double_t tol = 0.0);
0047 TDecompQRH(const TDecompQRH &another);
0048 ~TDecompQRH() override {}
0049
0050 Int_t GetNrows () const override { return fQ.GetNrows(); }
0051 Int_t GetNcols () const override { return fQ.GetNcols(); }
0052 virtual const TMatrixD &GetQ () { if ( !TestBit(kDecomposed) ) Decompose();
0053 return fQ; }
0054 virtual const TMatrixD &GetR () { if ( !TestBit(kDecomposed) ) Decompose();
0055 return fR; }
0056 virtual const TVectorD &GetUp () { if ( !TestBit(kDecomposed) ) Decompose();
0057 return fUp; }
0058 virtual const TVectorD &GetW () { if ( !TestBit(kDecomposed) ) Decompose();
0059 return fW; }
0060
0061 TMatrixD GetOrthogonalMatrix() const;
0062 const TMatrixD &GetTriangularMatrix() const { return fR; }
0063
0064 virtual void SetMatrix(const TMatrixD &a);
0065
0066 Bool_t Decompose () override;
0067 Bool_t Solve ( TVectorD &b) override;
0068 TVectorD Solve (const TVectorD& b,Bool_t &ok) override { TVectorD x = b; ok = Solve(x); return x; }
0069 Bool_t Solve ( TMatrixDColumn &b) override;
0070 Bool_t TransSolve ( TVectorD &b) override;
0071 TVectorD TransSolve (const TVectorD& b,Bool_t &ok) override { TVectorD x = b; ok = TransSolve(x); return x; }
0072 Bool_t TransSolve ( TMatrixDColumn &b) override;
0073 void Det (Double_t &d1,Double_t &d2) override;
0074
0075 Bool_t Invert (TMatrixD &inv);
0076 TMatrixD Invert (Bool_t &status);
0077 TMatrixD Invert () { Bool_t status; return Invert(status); }
0078
0079 void Print(Option_t *opt ="") const override;
0080
0081 TDecompQRH &operator= (const TDecompQRH &source);
0082
0083 ClassDefOverride(TDecompQRH,1)
0084 };
0085
0086 #endif