27 #include <vecLib/vBLAS.h> 46 Element *
New_m (Int_t size);
48 Int_t
Memcpy_m(Element *newp,
const Element *oldp,Int_t copySize,
49 Int_t newSize,Int_t oldSize);
50 void Allocate(Int_t nrows,Int_t ncols,Int_t row_lwb = 0,Int_t col_lwb = 0,Int_t init = 0,
63 TMatrixT(Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb);
64 TMatrixT(Int_t nrows,Int_t ncols,
const Element *data,Option_t *option=
"");
65 TMatrixT(Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb,
const Element *data,Option_t *option=
"");
127 ((
const_cast<TMatrixT<Element> *
>(
this))->Use(row_lwb,row_upb,col_lwb,col_upb, const_cast<Element *>(data))); }
145 virtual void Determinant (Double_t &d1,Double_t &d2)
const;
159 inline Element
operator()(Int_t rown,Int_t coln)
const;
160 inline Element &
operator()(Int_t rown,Int_t coln);
173 Error(
"operator=(const TMatrixT2 &)",
"matrices not compatible");
177 TObject::operator=(source);
180 for (Int_t i = 0; i < this->
fNelems; i++)
226 {
return Use(0,nrows-1,0,ncols-1,data); }
228 {
return Use(0,nrows-1,0,ncols-1,data); }
243 Option_t *option)
const 246 this->
GetSub(row_lwb,row_upb,col_lwb,col_upb,tmp,option);
253 const Int_t arown = rown-this->
fRowLwb;
254 const Int_t acoln = coln-this->
fColLwb;
255 if (arown >= this->
fNrows || arown < 0) {
256 Error(
"operator()",
"Request row(%d) outside matrix range of %d - %d",rown,this->fRowLwb,this->fRowLwb+this->
fNrows);
259 if (acoln >= this->
fNcols || acoln < 0) {
260 Error(
"operator()",
"Request column(%d) outside matrix range of %d - %d",coln,this->fColLwb,this->fColLwb+this->
fNcols);
270 const Int_t arown = rown-this->
fRowLwb;
271 const Int_t acoln = coln-this->
fColLwb;
272 if (arown >= this->
fNrows || arown < 0) {
273 Error(
"operator()",
"Request row(%d) outside matrix range of %d - %d",rown,this->fRowLwb,this->fRowLwb+this->
fNrows);
276 if (acoln >= this->
fNcols || acoln < 0) {
277 Error(
"operator()",
"Request column(%d) outside matrix range of %d - %d",coln,this->fColLwb,this->fColLwb+this->
fNcols);
300 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600 301 #pragma GCC diagnostic push 302 #pragma GCC diagnostic ignored "-Weffc++" 310 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600 311 #pragma GCC diagnostic pop 336 template <
class Element>
void AMultB (
const Element *
const ap,Int_t na,Int_t ncolsa,
337 const Element *
const bp,Int_t nb,Int_t ncolsb,Element *cp);
338 template <
class Element>
void AtMultB(
const Element *
const ap,Int_t ncolsa,
339 const Element *
const bp,Int_t nb,Int_t ncolsb,Element *cp);
340 template <
class Element>
void AMultBt(
const Element *
const ap,Int_t na,Int_t ncolsa,
341 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.
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
TMatrixT< Element > & operator/=(const TMatrixTDiag_const< Element > &diag)
Divide a matrix row by the diagonal of another matrix matrix(i,j) /= diag(j)
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
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 Int_t m
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.
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...
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)