12 #ifndef ROOT_TDecompLU
13 #define ROOT_TDecompLU
23 class TDecompLU :
public TDecompBase
35 static Bool_t DecomposeLUCrout(TMatrixD &lu,Int_t *index,Double_t &sign,Double_t tol,Int_t &nrZeros);
36 static Bool_t DecomposeLUGauss(TMatrixD &lu,Int_t *index,Double_t &sign,Double_t tol,Int_t &nrZeros);
38 virtual const TMatrixDBase &GetDecompMatrix()
const {
return fLU; }
43 explicit TDecompLU(Int_t nrows);
44 TDecompLU(Int_t row_lwb,Int_t row_upb);
45 TDecompLU(
const TMatrixD &m,Double_t tol = 0.0,Int_t implicit = 1);
46 TDecompLU(
const TDecompLU &another);
47 virtual ~TDecompLU() {
if (fIndex)
delete [] fIndex; fIndex = 0; }
49 const TMatrixD GetMatrix ();
50 virtual Int_t GetNrows ()
const {
return fLU.GetNrows(); }
51 virtual Int_t GetNcols ()
const {
return fLU.GetNcols(); }
52 const TMatrixD &GetLU () {
if ( !TestBit(kDecomposed) ) Decompose();
55 virtual void SetMatrix (
const TMatrixD &a);
57 virtual Bool_t Decompose ();
58 virtual Bool_t Solve ( TVectorD &b);
59 virtual TVectorD Solve (
const TVectorD& b,Bool_t &ok) { TVectorD x = b; ok = Solve(x);
return x; }
60 virtual Bool_t Solve ( TMatrixDColumn &b);
61 virtual Bool_t TransSolve ( TVectorD &b);
62 virtual TVectorD TransSolve (
const TVectorD& b,Bool_t &ok) { TVectorD x = b; ok = TransSolve(x);
return x; }
63 virtual Bool_t TransSolve ( TMatrixDColumn &b);
64 virtual void Det (Double_t &d1,Double_t &d2);
66 static Bool_t InvertLU (TMatrixD &a,Double_t tol,Double_t *det=0);
67 Bool_t Invert (TMatrixD &inv);
68 TMatrixD Invert (Bool_t &status);
69 TMatrixD Invert () { Bool_t status;
return Invert(status); }
71 void Print(Option_t *opt =
"")
const;
73 TDecompLU &operator= (
const TDecompLU &source);