23 #ifndef ROOT_TMatrixTBase 26 #ifndef ROOT_TMatrixTUtils 31 #include <vecLib/vBLAS.h> 128 ((
const_cast<TMatrixT<Element> *
>(
this))->Use(row_lwb,row_upb,col_lwb,col_upb, const_cast<Element *>(data))); }
174 Error(
"operator=(const TMatrixT2 &)",
"matrices not compatible");
227 {
return Use(0,nrows-1,0,ncols-1,data); }
229 {
return Use(0,nrows-1,0,ncols-1,data); }
247 this->
GetSub(row_lwb,row_upb,col_lwb,col_upb,tmp,option);
256 if (arown >= this->
fNrows || arown < 0) {
257 Error(
"operator()",
"Request row(%d) outside matrix range of %d - %d",rown,this->fRowLwb,this->fRowLwb+this->
fNrows);
260 if (acoln >= this->
fNcols || acoln < 0) {
261 Error(
"operator()",
"Request column(%d) outside matrix range of %d - %d",coln,this->fColLwb,this->fColLwb+this->
fNcols);
273 if (arown >= this->
fNrows || arown < 0) {
274 Error(
"operator()",
"Request row(%d) outside matrix range of %d - %d",rown,this->fRowLwb,this->fRowLwb+this->
fNrows);
277 if (acoln >= this->
fNcols || acoln < 0) {
278 Error(
"operator()",
"Request column(%d) outside matrix range of %d - %d",coln,this->fColLwb,this->fColLwb+this->
fNcols);
301 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600 302 #pragma GCC diagnostic push 303 #pragma GCC diagnostic ignored "-Weffc++" 311 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600 312 #pragma GCC diagnostic pop 337 template <
class Element>
void AMultB (
const Element *
const ap,
Int_t na,
Int_t ncolsa,
338 const Element *
const bp,
Int_t nb,
Int_t ncolsb,Element *cp);
339 template <
class Element>
void AtMultB(
const Element *
const ap,
Int_t ncolsa,
340 const Element *
const bp,
Int_t nb,
Int_t ncolsb,Element *cp);
341 template <
class Element>
void AMultBt(
const Element *
const ap,
Int_t na,
Int_t ncolsa,
342 const Element *
const bp,
Int_t nb,
Int_t ncolsb,Element *cp);
TMatrixT< Element > operator-(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
operation this = source1-source2
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 Delete_m(Int_t size, Element *&)
Delete data pointer m, if it was assigned on the heap.
Element Similarity(const TVectorT< Element > &v) const
Calculate scalar v * (*this) * v^T.
TMatrixT< Element > & Transpose(const TMatrixT< Element > &source)
Transpose matrix source.
void TMult(const TMatrixTSym< Element > &a, const TMatrixTSym< Element > &b)
Bool_t operator!=(Element val) const
Are all matrix elements not equal to val?
TMatrixT< Element > & Add(TMatrixT< Element > &target, Element scalar, const TMatrixT< Element > &source)
Modify addition: target += scalar * source.
virtual const Element * GetMatrixArray() const
TMatrixT< Element > operator &&(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
Logical AND.
TMatrixT< Element > & operator*=(Element val)
Multiply every element of the matrix with val.
void MultT(const TMatrixT< Element > &a, const TMatrixTSym< Element > &b)
TMatrixT< Element > & T()
const TMatrixTRow_const< Element > operator[](Int_t rown) const
Bool_t operator>(Element val) const
Are all matrix elements > val?
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.
TMatrixT< Element > operator*(Element val, const TMatrixT< Element > &source)
operation this = val*source
virtual Double_t Determinant() const
Return the matrix determinant.
virtual TMatrixTBase< Element > & ResizeTo(Int_t nrows, Int_t ncols, Int_t=-1)
Set size of the matrix to nrows x ncols New dynamic elements are created, the overlapping part of the...
void Minus(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
General matrix summation. Create a matrix C such that C = A - B.
#define ClassDef(name, id)
TMatrixT< Element > operator||(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
Logical OR.
void MultT(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
General matrix multiplication. Create a matrix C such that C = A * B^T.
Bool_t operator>=(Element val) const
Are all matrix elements >= val?
Element * New_m(Int_t size)
Return data pointer .
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.
TMatrixT< Element > & operator-=(Element val)
Subtract val from every element of the matrix.
TMatrixT< Element > operator+(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
operation this = source1+source2
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...
TMatrixT< Element > & operator/=(const TMatrixTDiag_const< Element > &diag)
Divide a matrix row by the diagonal of another matrix matrix(i,j) /= diag(j)
TObject & operator=(const TObject &rhs)
TObject assignment operator.
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 .
void TMult(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
Create a matrix C such that C = A' * B.
TMatrixT< Element > & Invert(Double_t *det=0)
Invert the matrix and calculate its determinant.
Element * fElements
data container
TMatrixT< Element > & Rank1Update(const TVectorT< Element > &v, Element alpha=1.0)
Perform a rank 1 operation on matrix A: A += alpha * v * v^T.
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.
virtual const Int_t * GetRowIndexArray() const
TMatrixT< Element > & ElementMult(TMatrixT< Element > &target, const TMatrixT< Element > &source)
Multiply target by the source, element-by-element.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
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...
virtual TMatrixTBase< Element > & SetSub(Int_t row_lwb, Int_t col_lwb, const TMatrixTBase< Element > &source)
Insert matrix source starting at [row_lwb][col_lwb], thereby overwriting the part [row_lwb...
The ROOT global object gROOT contains a list of all defined classes.
virtual const Int_t * GetColIndexArray() const
Element fDataStack[TMatrixTBase< Element >::kSizeMax]
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 .
TMatrixTRow< Element > operator[](Int_t rown)
virtual void Clear(Option_t *="")
Element operator()(Int_t rown, Int_t coln) const
TMatrixT< Element > & operator=(const TMatrixT< Element > &source)
Assignment operator.
TMatrixT< Element > & ElementDiv(TMatrixT< Element > &target, const TMatrixT< Element > &source)
Divide target by the source, element-by-element.
const TMatrixT< Element > & Use(Int_t row_lwb, Int_t row_upb, Int_t col_lwb, Int_t col_upb, const Element *data) const
TMatrixT(const TMatrixT< Element2 > &another)
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])
void Minus(const TMatrixTSym< Element > &a, const TMatrixT< Element > &b)
void Plus(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
General matrix summation. Create a matrix C such that C = A + B.
virtual Int_t * GetColIndexArray()
Templates of Lazy Matrix classes.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
TMatrixT< Element > & InvertFast(Double_t *det=0)
Invert the matrix and calculate its determinant, however upto (6x6) a fast Cramer inversion is used ...
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.
static Element & NaNValue()
void Plus(const TMatrixTSym< Element > &a, const TMatrixT< Element > &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. Create a matrix C such that C = A * B.
void TMult(const TMatrixTSym< Element > &a, const TMatrixT< Element > &b)
void MultT(const TMatrixTSym< Element > &a, const TMatrixTSym< Element > &b)
virtual TMatrixTBase< Element > & SetRowIndexArray(Int_t *)
virtual Int_t * GetRowIndexArray()
virtual TMatrixTBase< Element > & SetColIndexArray(Int_t *)
virtual 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
Get submatrix [row_lwb..row_upb] x [col_lwb..col_upb]; The indexing range of the returned matrix depe...
TMatrixTBase< Element > & ResizeTo(const TMatrixT< Element > &m)