12 #ifndef ROOT_TMatrixTSym 13 #define ROOT_TMatrixTSym 27 #ifndef ROOT_TMatrixTBase 30 #ifndef ROOT_TMatrixTUtils 34 template<
class Element>
class TMatrixT;
36 template<
class Element>
class TVectorT;
79 void TMult(
const TMatrixT <Element> &a);
104 ((
const_cast<TMatrixTSym<Element> *
>(
this))->Use(row_lwb,row_upb,const_cast<Element *>(data))); }
135 Element
Similarity (
const TVectorT <Element> &v)
const;
144 inline TMatrixTRow <Element>
operator[](
Int_t rown) {
return TMatrixTRow <Element>(*
this,rown); }
151 Error(
"operator=(const TMatrixTSym2 &)",
"matrices not compatible");
198 {
return Use(0,nrows-1,data); }
208 this->
GetSub(row_lwb,row_upb,col_lwb,col_upb,tmp,option);
217 if (arown >= this->
fNrows || arown < 0) {
218 Error(
"operator()",
"Request row(%d) outside matrix range of %d - %d",rown,this->fRowLwb,this->fRowLwb+this->
fNrows);
221 if (acoln >= this->
fNcols || acoln < 0) {
222 Error(
"operator()",
"Request column(%d) outside matrix range of %d - %d",coln,this->fColLwb,this->fColLwb+this->
fNcols);
233 if (arown >= this->
fNrows || arown < 0) {
234 Error(
"operator()",
"Request row(%d) outside matrix range of %d - %d",rown,this->fRowLwb,this->fRowLwb+this->
fNrows);
237 if (acoln >= this->
fNcols || acoln < 0) {
238 Error(
"operator()",
"Request column(%d) outside matrix range of %d - %d",coln,this->fColLwb,this->fColLwb+this->
fNcols);
254 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600 255 #pragma GCC diagnostic push 256 #pragma GCC diagnostic ignored "-Weffc++" 260 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600 261 #pragma GCC diagnostic pop
const TMatrixTRow_const< Element > operator[](Int_t rown) const
TMatrixTSym< Element > & SimilarityT(const TMatrixT< Element > &n)
Calculate B^T * (*this) * B , final matrix will be (ncolsb x ncolsb) It is more efficient than applyi...
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...
virtual Int_t * GetColIndexArray()
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...
TMatrixTSym< Element > & Use(Int_t row_lwb, Int_t row_upb, Element *data)
TMatrixTSym< Element > & ElementMult(TMatrixTSym< Element > &target, const TMatrixTSym< Element > &source)
Multiply target by the source, element-by-element.
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.
virtual TMatrixTBase< Element > & SetRowIndexArray(Int_t *)
TMatrixTSym< Element > & operator=(const TMatrixTSym< Element > &source)
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...
Element fDataStack[TMatrixTBase< Element >::kSizeMax]
const TMatrixT< Element > EigenVectors(TVectorT< Element > &eigenValues) const
Return a matrix containing the eigen-vectors ordered by descending eigen-values.
void TMult(const TMatrixT< Element > &a)
Create a matrix C such that C = A' * A.
virtual void Clear(Option_t *="")
TMatrixTSym< Element > & operator*=(Element val)
Multiply every element of the matrix with val.
TMatrixTSym< Element > & Rank1Update(const TVectorT< Element > &v, Element alpha=1.0)
Perform a rank 1 operation on the matrix: A += alpha * v * v^T.
double beta(double x, double y)
Calculates the beta function.
void Mult(const TMatrixTSym< Element > &a)
#define ClassDef(name, id)
TMatrixTSym< Element > & operator+=(Element val)
Add val to every element of the matrix.
Element operator()(Int_t rown, Int_t coln) const
virtual Double_t Determinant() const
TMatrixTSym< Element > & T()
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 .
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TMatrixTRow< Element > operator[](Int_t rown)
virtual TMatrixTBase< Element > & SetMatrixArray(const Element *data, Option_t *option="")
Copy array data to matrix .
void Minus(const TMatrixTSym< Element > &a, const TMatrixTSym< Element > &b)
Symmetric matrix summation. Create a matrix C such that C = A + B.
virtual const Element * GetMatrixArray() const
virtual TMatrixTBase< Element > & SetColIndexArray(Int_t *)
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 .
TMatrixTBase< Element > & Apply(const TElementActionT< Element > &action)
Apply action to each matrix element.
TMatrixTSym< Element > operator||(const TMatrixTSym< Element > &source1, const TMatrixTSym< Element > &source2)
Logical Or.
Bool_t operator==(Element val) const
Are all matrix elements equal to val?
TMatrixTSym< Element > & Add(TMatrixTSym< Element > &target, Element scalar, const TMatrixTSym< Element > &source)
Modify addition: target += scalar * source.
The ROOT global object gROOT contains a list of all defined classes.
virtual TMatrixTBase< Element > & Randomize(Element alpha, Element beta, Double_t &seed)
randomize matrix element values but keep matrix symmetric
TMatrixTSym< Element > operator-(const TMatrixTSym< Element > &source1, const TMatrixTSym< Element > &source2)
TMatrixTBase< Element > & ResizeTo(const TMatrixTSym< Element > &m)
TMatrixTSym< Element > & Transpose(const TMatrixTSym< Element > &source)
Transpose a matrix.
TMatrixTSym(const TMatrixTSym< Element2 > &another)
const TMatrixTSym< Element > & Use(Int_t row_lwb, Int_t row_upb, const Element *data) const
void Plus(const TMatrixTSym< Element > &a, const TMatrixTSym< Element > &b)
Symmetric matrix summation. Create a matrix C such that C = A + B.
TMatrixTSym< Element > & operator-=(Element val)
Subtract val from every element of the matrix.
Bool_t operator>=(Element val) const
Are all matrix elements >= val?
virtual TMatrixTSym< Element > & RandomizePD(Element alpha, Element beta, Double_t &seed)
randomize matrix element values but keep matrix symmetric positive definite
TMatrixTSym< Element > & InvertFast(Double_t *det=0)
Invert the matrix and calculate its determinant.
TMatrixTSym< Element > & SetSub(Int_t row_lwb, const TMatrixTBase< Element > &source)
Insert matrix source starting at [row_lwb][row_lwb], thereby overwriting the part [row_lwb...
TMatrixTSym< Element > & Similarity(const TMatrixT< Element > &n)
Calculate B * (*this) * B^T , final matrix will be (nrowsb x nrowsb) This is a similarity transform w...
virtual const Int_t * GetRowIndexArray() const
void Delete_m(Int_t size, Element *&)
delete data pointer m, if it was assigned on the heap
TMatrixTSym< Element > & Invert(Double_t *det=0)
Invert the matrix and calculate its determinant Notice that the LU decomposition is used instead of B...
Bool_t operator>(Element val) const
Are all matrix elements > val?
virtual const Int_t * GetColIndexArray() const
virtual Bool_t IsSymmetric() const
Check whether matrix is symmetric.
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
TMatrixTSym< Element > operator+(const TMatrixTSym< Element > &source1, const TMatrixTSym< Element > &source2)
virtual Int_t * GetRowIndexArray()
static Element & NaNValue()
Element * New_m(Int_t size)
return data pointer .
TMatrixTSym< Element > & ElementDiv(TMatrixTSym< Element > &target, const TMatrixTSym< Element > &source)
Multiply target by the source, element-by-element.
TMatrixTSym< Element > operator*(const TMatrixTSym< Element > &source, Element val)
Element * fElements
data container
TMatrixTSym< Element > operator&&(const TMatrixTSym< Element > &source1, const TMatrixTSym< Element > &source2)
Logical AND.
TMatrixTSym< Element > & GetSub(Int_t row_lwb, Int_t row_upb, TMatrixTSym< Element > &target, Option_t *option="S") const
Get submatrix [row_lwb..row_upb][row_lwb..row_upb]; The indexing range of the returned matrix depends...