Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TDecompBK.h
Go to the documentation of this file.
1// @(#)root/matrix:$Id$
2// Authors: Fons Rademakers, Eddy Offermann Sep 2004
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TDecompBK
13#define ROOT_TDecompBK
14
15///////////////////////////////////////////////////////////////////////////
16// //
17// Bunch-Kaufman Decomposition class //
18// //
19///////////////////////////////////////////////////////////////////////////
20
21#include "Rtypes.h"
22#include "TDecompBase.h"
23#include "TMatrixDSym.h"
24#include "TVectorD.h"
25
26class TDecompBK : public TDecompBase
27{
28protected :
29
30 Int_t fNIpiv; // size of row permutation index
31 Int_t *fIpiv; //[fNIpiv] row permutation index
32 TMatrixD fU; // decomposed matrix so that a = u d u^T
33
34 const TMatrixDBase &GetDecompMatrix() const override { return fU; }
35
36public :
37
38 TDecompBK();
39 explicit TDecompBK(Int_t nrows);
40 TDecompBK(Int_t row_lwb,Int_t row_upb);
41 TDecompBK(const TMatrixDSym &m,Double_t tol = 0.0);
42 TDecompBK(const TDecompBK &another);
43 ~TDecompBK() override {if (fIpiv) delete [] fIpiv; fIpiv = nullptr; }
44
45 Int_t GetNrows () const override { return fU.GetNrows(); }
46 Int_t GetNcols () const override { return fU.GetNcols(); }
47 const TMatrixD &GetU () { if ( !TestBit(kDecomposed) ) Decompose();
48 return fU; }
49
50 virtual void SetMatrix (const TMatrixDSym &a);
51
52 Bool_t Decompose () override;
53 Bool_t Solve ( TVectorD &b) override;
54 TVectorD Solve (const TVectorD& b,Bool_t &ok) override { TVectorD x = b; ok = Solve(x); return x; }
55 Bool_t Solve ( TMatrixDColumn &b) override;
56 Bool_t TransSolve ( TVectorD &b) override { return Solve(b); }
57 TVectorD TransSolve (const TVectorD& b,Bool_t &ok) override { TVectorD x = b; ok = Solve(x); return x; }
58 Bool_t TransSolve ( TMatrixDColumn &b) override { return Solve(b); }
59 void Det (Double_t &/*d1*/,Double_t &/*d2*/) override
60 { MayNotUse("Det(Double_t&,Double_t&)"); }
61
63 TMatrixDSym Invert (Bool_t &status);
64 TMatrixDSym Invert () { Bool_t status; return Invert(status); }
65
66 void Print(Option_t *opt ="") const override; // *MENU*
67
68 TDecompBK &operator= (const TDecompBK &source);
69
70 ClassDefOverride(TDecompBK,1) // Matrix Decomposition Bunch-Kaufman
71};
72
73#endif
#define b(i)
Definition RSha256.hxx:100
#define a(i)
Definition RSha256.hxx:99
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
double Double_t
Definition RtypesCore.h:59
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
The Bunch-Kaufman diagonal pivoting method decomposes a real symmetric matrix A using.
Definition TDecompBK.h:27
Int_t GetNrows() const override
Definition TDecompBK.h:45
TDecompBK & operator=(const TDecompBK &source)
Assignment operator.
TDecompBK()
Default constructor.
Definition TDecompBK.cxx:64
Int_t GetNcols() const override
Definition TDecompBK.h:46
const TMatrixD & GetU()
Definition TDecompBK.h:47
TMatrixDSym Invert()
Definition TDecompBK.h:64
Bool_t TransSolve(TMatrixDColumn &b) override
Definition TDecompBK.h:58
Bool_t Decompose() override
Matrix A is decomposed in components U and D so that A = U*D*U^T If the decomposition succeeds,...
Int_t fNIpiv
Definition TDecompBK.h:30
void Det(Double_t &, Double_t &) override
Matrix determinant det = d1*TMath::Power(2.,d2)
Definition TDecompBK.h:59
Bool_t Solve(TVectorD &b) override
Solve Ax=b assuming the BK form of A is stored in fU . Solution returned in b.
TVectorD Solve(const TVectorD &b, Bool_t &ok) override
Definition TDecompBK.h:54
TMatrixD fU
Definition TDecompBK.h:32
virtual void SetMatrix(const TMatrixDSym &a)
Set the matrix to be decomposed, decomposition status is reset.
void Print(Option_t *opt="") const override
Print the class members.
const TMatrixDBase & GetDecompMatrix() const override
Definition TDecompBK.h:34
Bool_t TransSolve(TVectorD &b) override
Definition TDecompBK.h:56
Int_t * fIpiv
Definition TDecompBK.h:31
TVectorD TransSolve(const TVectorD &b, Bool_t &ok) override
Definition TDecompBK.h:57
~TDecompBK() override
Definition TDecompBK.h:43
Decomposition Base class.
Definition TDecompBase.h:34
Int_t GetNrows() const
Int_t GetNcols() const
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:199
void MayNotUse(const char *method) const
Use this method to signal that a method (defined in a base class) may not be called in a derived clas...
Definition TObject.cxx:1040
Double_t x[n]
Definition legend1.C:17
void inv(rsa_NUMBER *, rsa_NUMBER *, rsa_NUMBER *)
Definition rsaaux.cxx:949
TMarker m
Definition textangle.C:8