27#include <vecLib/vBLAS.h>
149 return ResizeTo(
m.GetRowLwb(),
m.GetRowUpb(),
m.GetColLwb(),
m.GetColUpb());
181 Error(
"operator=(const TMatrixT2 &)",
"matrices not compatible");
190 this->
fTol = source.GetTol();
238 return Use(
a.GetRowLwb(),
a.GetRowUpb(),
239 a.GetColLwb(),
a.GetColUpb(),
a.GetMatrixArray());
244 return Use(
a.GetRowLwb(),
a.GetRowUpb(),
245 a.GetColLwb(),
a.GetColUpb(),
a.GetMatrixArray());
262 Error(
"operator()",
"Request row(%d) outside matrix range of %d - %d",
rown,this->fRowLwb,this->fRowLwb+this->fNrows);
266 Error(
"operator()",
"Request column(%d) outside matrix range of %d - %d",
coln,this->fColLwb,this->fColLwb+this->fNcols);
279 Error(
"operator()",
"Request row(%d) outside matrix range of %d - %d",
rown,this->fRowLwb,this->fRowLwb+this->fNrows);
283 Error(
"operator()",
"Request column(%d) outside matrix range of %d - %d",
coln,this->fColLwb,this->fColLwb+this->fNcols);
293template <
class Element>
301 fElements[
rown * this->fNcols +
coln] = val;
323#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
324#pragma GCC diagnostic push
325#pragma GCC diagnostic ignored "-Weffc++"
333#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
334#pragma GCC diagnostic pop
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
#define ClassDefOverride(name, id)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Bool_t operator<=(const TDatime &d1, const TDatime &d2)
Bool_t operator>(const TDatime &d1, const TDatime &d2)
Bool_t operator!=(const TDatime &d1, const TDatime &d2)
Bool_t operator>=(const TDatime &d1, const TDatime &d2)
Bool_t operator<(const TDatime &d1, const TDatime &d2)
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
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 Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t target
TString operator+(const TString &s1, const TString &s2)
Use the special concatenation constructor.
TTime operator*(const TTime &t1, const TTime &t2)
TTime operator-(const TTime &t1, const TTime &t2)
TClass instances represent classes, structs and namespaces in the ROOT type system.
static Element & NaNValue()
Templates of Lazy Matrix classes.
TMatrixTBase< Element > & GetSub(Int_t row_lwb, Int_t row_upb, Int_t col_lwb, Int_t col_upb, TMatrixTBase< Element > &target, Option_t *option="S") const override
Get submatrix [row_lwb..row_upb] x [col_lwb..col_upb]; The indexing range of the returned matrix depe...
void MultT(const TMatrixTSym< Element > &a, const TMatrixTSym< Element > &b)
TMatrixT< Element > & Rank1Update(const TVectorT< Element > &v, Element alpha=1.0)
Perform a rank 1 operation on matrix A: A += alpha * v * v^T.
const TMatrixT< Element > & Use(Int_t nrows, Int_t ncols, const Element *data) const
void TMult(const TMatrixTSym< Element > &a, const TMatrixT< Element > &b)
TMatrixT< Element > & Use(Int_t row_lwb, Int_t row_upb, Int_t col_lwb, Int_t col_upb, Element *data)
Use the array data to fill the matrix ([row_lwb..row_upb] x [col_lwb..col_upb])
Int_t * GetColIndexArray() override
const TMatrixTRow_const< Element > operator[](Int_t rown) const
void Clear(Option_t *="") override
void Delete_m(Int_t size, Element *&)
Delete data pointer m, if it was assigned on the heap.
void SetElement(Int_t rown, Int_t coln, Element val)
Efficiently sets element (rown,coln) equal to val Index bound checks can be deactivated by defining N...
TMatrixT< Element > & operator*=(Element val)
Multiply every element of the matrix with val.
const Int_t * GetRowIndexArray() const override
TMatrixT< Element > GetSub(Int_t row_lwb, Int_t row_upb, Int_t col_lwb, Int_t col_upb, Option_t *option="S") const
Element fDataStack[TMatrixTBase< Element >::kSizeMax]
TMatrixT(const TMatrixT< Element2 > &another)
TMatrixT< Element > & Use(TMatrixT< Element > &a)
Element & operator()(Int_t rown, Int_t coln) override
TMatrixT< Element > & T()
TMatrixT< Element > & operator=(const TMatrixT< Element > &source)
Assignment operator.
const TMatrixT< Element > & Use(const TMatrixT< Element > &a) const
TMatrixT< Element > & NormByRow(const TVectorT< Element > &v, Option_t *option="D")
Multiply/divide matrix rows with a vector: option: "D" : b(i,j) = a(i,j)/v(j) i = 0,...
const Int_t * GetColIndexArray() const override
const Element * GetMatrixArray() const override
void MultT(const TMatrixT< Element > &a, const TMatrixTSym< Element > &b)
void Minus(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
General matrix subtraction. Replace this matrix with C such that C = A - B.
Element Similarity(const TVectorT< Element > &v) const
Calculate scalar v * (*this) * v^T.
TMatrixT< Element > & Use(Int_t nrows, Int_t ncols, Element *data)
void Plus(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
General matrix summation. Replace this matrix with C such that C = A + B.
TMatrixTBase< Element > & ResizeTo(const TMatrixT< Element > &m)
void Minus(const TMatrixTSym< Element > &a, const TMatrixT< Element > &b)
Element operator()(Int_t rown, Int_t coln) const override
TMatrixT< Element > & operator-=(Element val)
Subtract val from every element of the matrix.
Double_t Determinant() const override
Return the matrix determinant.
TMatrixT< Element > & Transpose(const TMatrixT< Element > &source)
Transpose matrix source.
TMatrixTBase< Element > & SetRowIndexArray(Int_t *) override
void MultT(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
General matrix multiplication. Replace this matrix with C such that C = A * B^T.
TMatrixT< Element > & InvertFast(Double_t *det=nullptr)
Invert the matrix and calculate its determinant, however upto (6x6) a fast Cramer inversion is used .
void TMult(const TMatrixTSym< Element > &a, const TMatrixTSym< Element > &b)
TMatrixTBase< Element > & SetColIndexArray(Int_t *) override
TMatrixTBase< Element > & SetSub(Int_t row_lwb, Int_t col_lwb, const TMatrixTBase< Element > &source) override
Insert matrix source starting at [row_lwb][col_lwb], thereby overwriting the part [row_lwb....
Element * New_m(Int_t size)
Return data pointer .
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...
TMatrixT< Element > & Invert(Double_t *det=nullptr)
Invert the matrix and calculate its determinant.
TMatrixTRow< Element > operator[](Int_t rown)
Int_t * GetRowIndexArray() override
void Allocate(Int_t nrows, Int_t ncols, Int_t row_lwb=0, Int_t col_lwb=0, Int_t init=0, Int_t=-1)
Allocate new matrix.
void Plus(const TMatrixTSym< Element > &a, const TMatrixT< Element > &b)
TMatrixT< Element > & operator+=(Element val)
Add val to every element of the matrix.
TMatrixT< Element > & NormByColumn(const TVectorT< Element > &v, Option_t *option="D")
Multiply/divide matrix columns by a vector: option: "D" : b(i,j) = a(i,j)/v(i) i = 0,...
void TMult(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
Replace this matrix with C such that C = A' * B.
const TMatrixT< Element > EigenVectors(TVectorT< Element > &eigenValues) const
Return a matrix containing the eigen-vectors ordered by descending values of Re^2+Im^2 of the complex...
void Mult(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
General matrix multiplication. Replace this matrix with C such that C = A * B.
Element * fElements
data container
Int_t Memcpy_m(Element *newp, const Element *oldp, Int_t copySize, Int_t newSize, Int_t oldSize)
Copy copySize doubles from *oldp to *newp .
TMatrixT< Element > & operator/=(const TMatrixTDiag_const< Element > &diag)
Divide a matrix row by the diagonal of another matrix matrix(i,j) /= diag(j)
const TMatrixT< Element > & Use(Int_t row_lwb, Int_t row_upb, Int_t col_lwb, Int_t col_upb, const Element *data) const
Element * GetMatrixArray() override
TObject & operator=(const TObject &rhs)
TObject assignment operator.
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...
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
void AMultBt(const Element *const ap, Int_t na, Int_t ncolsa, const Element *const bp, Int_t nb, Int_t ncolsb, Element *cp)
Elementary routine to calculate matrix multiplication A*B^T.
void AMultB(const Element *const ap, Int_t na, Int_t ncolsa, const Element *const bp, Int_t nb, Int_t ncolsb, Element *cp)
Elementary routine to calculate matrix multiplication A*B.
void AtMultB(const Element *const ap, Int_t ncolsa, const Element *const bp, Int_t nb, Int_t ncolsb, Element *cp)
Elementary routine to calculate matrix multiplication A^T*B.
TMatrixT< Element > & ElementMult(TMatrixT< Element > &target, const TMatrixT< Element > &source)
Multiply target by the source, element-by-element.
TMatrixT< Element > operator||(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
Logical OR.
TMatrixT< Element > & Add(TMatrixT< Element > &target, Element scalar, const TMatrixT< Element > &source)
Modify addition: target += scalar * source.
TMatrixT< Element > & ElementDiv(TMatrixT< Element > &target, const TMatrixT< Element > &source)
Divide target by the source, element-by-element.
TMatrixT< Element > operator&&(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
Logical AND.
Bool_t AreCompatible(const TMatrixTBase< Element1 > &m1, const TMatrixTBase< Element2 > &m2, Int_t verbose=0)
Check that matrice sm1 and m2 areboth valid and have identical shapes .