55 Error(
"TDecompSVD(Int_t,Int_t",
"matrix rows should be >= columns");
72 Error(
"TDecompSVD(Int_t,Int_t,Int_t,Int_t",
"matrix rows should be >= columns");
88 if (
a.GetNrows() <
a.GetNcols()) {
89 Error(
"TDecompSVD(const TMatrixD &",
"matrix rows should be >= columns");
128 Error(
"Decompose()",
"Matrix has not been set");
320 const Double_t eps = std::numeric_limits<double>::epsilon();
337 for (
Int_t ll = k; ll >= 0 ; ll--) {
355 ::Error(
"TDecompSVD::Diagonalize",
"no convergence after %d steps",
niter);
379 for (
Int_t i = k-1; i >= 0; i--) {
400 for (
Int_t i =
l; i <= k; i++) {
430 if (
psl == 0.0 ||
pok == 0.0 ||
psk1 == 0.0) {
435 if ((
b != 0.0) | (
c != 0.0)) {
456 for (
Int_t i =
l; i <= k-1; i++) {
513 while (!found && i <
nCol_v) {
520 for (i = 1; i <
nCol_v; i++) {
560 Error(
"GetMatrix()",
"Matrix is singular");
565 Error(
"GetMatrix()",
"Decomposition failed");
587 if (
a.GetNrows() <
a.GetNcols()) {
588 Error(
"TDecompSVD(const TMatrixD &",
"matrix rows should be >= columns");
629 Error(
"Solve(TVectorD &",
"vector and matrix incompatible");
685 Error(
"Solve(TMatrixDColumn &",
"vector and matrix incompatible");
736 Error(
"TransSolve(TVectorD &",
"matrix should be square");
742 Error(
"TransSolve(TVectorD &",
"vector and matrix incompatible");
786 Error(
"TransSolve(TMatrixDColumn &",
"matrix should be square");
792 Error(
"TransSolve(TMatrixDColumn &",
"vector and matrix incompatible");
889 Error(
"Invert(TMatrixD &",
"Input matrix has wrong shape");
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Bool_t DefHouseHolder(const TVectorD &vc, Int_t lp, Int_t l, Double_t &up, Double_t &b, Double_t tol=0.0)
Define a Householder-transformation through the parameters up and b .
void ApplyGivens(Double_t &z1, Double_t &z2, Double_t c, Double_t s)
Apply a Givens transformation as defined by c and s to the vector components v1 and v2 .
void ApplyHouseHolder(const TVectorD &vc, Double_t up, Double_t b, Int_t lp, Int_t l, TMatrixDRow &cr)
Apply Householder-transformation.
void DefGivens(Double_t v1, Double_t v2, Double_t &c, Double_t &s)
Defines a Givens-rotation by calculating 2 rotation parameters c and s.
void DefAplGivens(Double_t &v1, Double_t &v2, Double_t &c, Double_t &s)
Define and apply a Givens-rotation by calculating 2 rotation parameters c and s.
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
TMatrixTRow< Double_t > TMatrixDRow
TMatrixTColumn_const< Double_t > TMatrixDColumn_const
TMatrixTDiag< Double_t > TMatrixDDiag
TMatrixTRow_const< Double_t > TMatrixDRow_const
TMatrixTColumn< Double_t > TMatrixDColumn
TMatrixT< Double_t > TMatrixD
Array of doubles (64 bits per element).
Decomposition Base class.
static void DiagProd(const TVectorD &diag, Double_t tol, Double_t &d1, Double_t &d2)
virtual Bool_t MultiSolve(TMatrixD &B)
Solve set of equations with RHS in columns of B.
TDecompBase & operator=(const TDecompBase &source)
Assignment operator.
void Print(Option_t *opt="") const override
Print class members.
Single Value Decomposition class.
void Det(Double_t &d1, Double_t &d2) override
Matrix determinant det = d1*TMath::Power(2.,d2)
static void Diag_3(TMatrixD &v, TMatrixD &u, TVectorD &sDiag, TVectorD &oDiag, Int_t k, Int_t l)
Step 3 in the matrix diagonalization.
static void Diag_2(TVectorD &sDiag, TVectorD &oDiag, Int_t k, Int_t l)
Step 2 in the matrix diagonalization.
TDecompSVD & operator=(const TDecompSVD &source)
Assignment operator.
Bool_t Solve(TVectorD &b) override
Solve Ax=b assuming the SVD form of A is stored .
static Bool_t Bidiagonalize(TMatrixD &v, TMatrixD &u, TVectorD &sDiag, TVectorD &oDiag)
Bidiagonalize the (m x n) - matrix a (stored in v) through a series of Householder transformations ap...
static void Diag_1(TMatrixD &v, TVectorD &sDiag, TVectorD &oDiag, Int_t k)
Step 1 in the matrix diagonalization.
static Bool_t Diagonalize(TMatrixD &v, TMatrixD &u, TVectorD &sDiag, TVectorD &oDiag)
Diagonalizes in an iterative fashion the bidiagonal matrix C as described through sDiag and oDiag,...
Double_t Condition() override
Matrix condition number.
Bool_t Decompose() override
SVD decomposition of matrix If the decomposition succeeds, bit kDecomposed is set ,...
Int_t GetNrows() const override
const TMatrixD GetMatrix()
Reconstruct the original matrix using the decomposition parts.
Bool_t TransSolve(TVectorD &b) override
Solve A^T x=b assuming the SVD form of A is stored . Solution returned in b.
virtual void SetMatrix(const TMatrixD &a)
Set matrix to be decomposed.
Int_t GetNcols() const override
static void SortSingular(TMatrixD &v, TMatrixD &u, TVectorD &sDiag)
Perform a permutation transformation on the diagonal matrix S', so that matrix S'' = U''^T .
void Print(Option_t *opt="") const override
Print class members.
virtual TMatrixTBase< Element > & UnitMatrix()
Make a unit matrix (matrix need not be a square one).
void Print(Option_t *name="") const override
Print the matrix as a table of elements.
virtual TMatrixTBase< Element > & Shift(Int_t row_shift, Int_t col_shift)
Shift the row index by adding row_shift and the column index by adding col_shift, respectively.
const TMatrixTBase< Element > * GetMatrix() const
const Element * GetMatrixArray() const override
TMatrixT< Element > & Transpose(const TMatrixT< Element > &source)
Transpose matrix source.
TMatrixTBase< Element > & ResizeTo(Int_t nrows, Int_t ncols, Int_t=-1) override
Set size of the matrix to nrows x ncols New dynamic elements are created, the overlapping part of the...
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TVectorT< Element > & Shift(Int_t row_shift)
TVectorT< Element > & ResizeTo(Int_t lwb, Int_t upb)
Resize the vector to [lwb:upb] .
void Print(Option_t *option="") const override
Print the vector as a list of elements.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Sqrt(Double_t x)
Returns the square root of x.
Double_t Hypot(Double_t x, Double_t y)
Returns sqrt(x*x + y*y)
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
void inv(rsa_NUMBER *, rsa_NUMBER *, rsa_NUMBER *)