ROOT logo
ROOT » MATH » SMATRIX » ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >

class ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >


    SMatrix: a generic fixed size D1 x D2 Matrix class.
    The class is template on the scalar type, on the matrix sizes:
    D1 = number of rows and D2 = number of columns
    amd on the representation storage type.
    By default the representation is MatRepStd<T,D1,D2> (standard D1xD2 of type T),
    but it can be of type MatRepSym<T,D> for symmetric matrices DxD, where the storage is only
    D*(D+1)/2.

    See \ref SMatrixDoc.

    Original author is Thorsten Glebe
    HERA-B Collaboration, MPI Heidelberg (Germany)

    @ingroup SMatrixSVector

    @authors T. Glebe, L. Moneta and J. Palacios


 SMatrix: column-wise storage

Function Members (Methods)

public:
~SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >()
Double32_tapply(unsigned int i) const
const Double32_t*Array() const
Double32_t*Array()
const Double32_t&At(unsigned int i, unsigned int j) const
Double32_t&At(unsigned int i, unsigned int j)
ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >::iteratorbegin()
ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >::const_iteratorbegin() const
ROOT::Math::SVector<Double32_t,3>Col(unsigned int thecol) const
boolDet(Double32_t& det)
boolDet2(Double32_t& det) const
ROOT::Math::SVector<Double32_t,3>Diagonal() const
ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >::iteratorend()
ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >::const_iteratorend() const
ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >Inverse(int& ifail) const
ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >InverseChol(int& ifail) const
ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >InverseFast(int& ifail) const
boolInvert()
boolInvertChol()
boolInvertFast()
boolIsInUse(const Double32_t* p) const
ROOT::Math::SVector<Double32_t,3*(3+1)/2>LowerBlock() const
booloperator!=(const Double32_t& rhs) const
booloperator!=(const ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >& rhs) const
const Double32_t&operator()(unsigned int i, unsigned int j) const
Double32_t&operator()(unsigned int i, unsigned int j)
ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >&operator*=(const Double32_t& rhs)
ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >&operator+=(const Double32_t& rhs)
ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >&operator-=(const Double32_t& rhs)
ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >&operator/=(const Double32_t& rhs)
booloperator<(const Double32_t& rhs) const
ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >&operator=(ROOT::Math::SMatrixIdentity)
ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >&operator=(const Double32_t& rhs)
ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >&operator=(const ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >&)
booloperator==(const Double32_t& rhs) const
booloperator>(const Double32_t& rhs) const
ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >::SMatrixRow_constoperator[](unsigned int i) const
ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >::SMatrixRowoperator[](unsigned int i)
ostream&Print(ostream& os) const
ROOT::Math::SVector<Double32_t,3>Row(unsigned int therow) const
ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >()
ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >(ROOT::Math::SMatrixIdentity)
ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >(const ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >& rhs)
ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >(const Double32_t& rhs)
ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >(const ROOT::Math::SVector<Double32_t,3*(3+1)/2>& v, bool lower = true)
Double32_tTrace() const
ROOT::Math::SVector<Double32_t,3*(3+1)/2>UpperBlock() const

Data Members

private:
enum { kRows
kCols
kSize
};

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

SMatrix<T,D1,D2,R>& operator=(const M& rhs)
       Assign from another compatible matrix.
       Possible Symmetirc to general but NOT vice-versa

SMatrix<T,D1,D2,R>& operator=(const Expr<A,T,D1,D2,R2>& rhs)
       Assign from a matrix expression

SMatrix<T,D1,D2,R> & operator=(SMatrixIdentity )
      Assign from an identity matrix

T apply(unsigned int i) const
 @name --- Access functions --- 
 access the parse tree with the index starting from zero and
       following the C convention for the order in accessing
       the matrix elements.
       Same convention for general and symmetric matrices.

const T* Array()
 return read-only pointer to internal array
T* Array()
iterator begin()
 @name --- STL-like interface ---
       The iterators access the matrix element in the order how they are
       stored in memory. The C (row-major) convention is used, and in the
       case of symmetric matrices the iterator spans only the lower diagonal
       block. For example for a symmetric 3x3 matrices the order of the 6
       elements \f${a_0,...a_5}\f$ is:
       \f[
       M = \left( \begin{array}{ccc}
       a_0 & a_1 & a_3  \\
       a_1 & a_2  & a_4  \\
       a_3 & a_4 & a_5   \end{array} \right)
       \f]

 STL iterator interface. 
iterator end()
 STL iterator interface. 
const_iterator begin()
 STL const_iterator interface. 
const_iterator end()
 STL const_iterator interface. 
bool operator==(const Double32_t& rhs) const
 @name --- Operators --- 
 element wise comparison
bool operator!=(const T& rhs)
 element wise comparison
bool operator!=(const SMatrix<T,D1,D2,R>& rhs)
 element wise comparison
bool operator>(const Double32_t& rhs) const
 element wise comparison
bool operator<(const Double32_t& rhs) const
 element wise comparison
const T& operator()(unsigned int i, unsigned int j)
      read only access to matrix element, with indices starting from 0

T& operator()(unsigned int i, unsigned int j)
const T& At(unsigned int i, unsigned int j)
      read only access to matrix element, with indices starting from 0.
      Fuction will check index values and it will assert if they are wrong

T& At(unsigned int i, unsigned int j)
T & operator[](int j)
{ return (*fMat)(fRow,j); }
const T & operator[](int j)
{ return (*fMat)(fRow, j); }
SMatrix<T,D1,D2,R>& operator+=(const Double32_t& rhs)
      addition with a scalar

SMatrix<T,D1,D2,R>& operator-=(const Double32_t& rhs)
      subtraction with a scalar

SMatrix<T,D1,D2,R>& operator*=(const Double32_t& rhs)
      multiplication with a scalar

SMatrix<T,D1,D2,R>& operator/=(const Double32_t& rhs)
      division with a scalar

bool Invert()
 @name --- Linear Algebra Functions --- 

      Invert a square Matrix ( this method changes the current matrix).
      Return true if inversion is successfull.
      The method used for general square matrices is the LU factorization taken from Dinv routine
      from the CERNLIB (written in C++ from CLHEP authors)
      In case of symmetric matrices Bunch-Kaufman diagonal pivoting method is used
      (The implementation is the one written by the CLHEP authors)

SMatrix<T,D1,D2,R> Inverse(int& ifail) const
      Invert a square Matrix and  returns a new matrix. In case the inversion fails
      the current matrix is returned.
      \param ifail . ifail will be set to 0 when inversion is successfull.
      See ROOT::Math::SMatrix::Invert for the inversion algorithm

bool InvertFast()
      Fast Invertion of a square Matrix ( this method changes the current matrix).
      Return true if inversion is successfull.
      The method used is based on direct inversion using the Cramer rule for
      matrices upto 5x5. Afterwards the same defult algorithm of Invert() is used.
      Note that this method is faster but can suffer from much larger numerical accuracy
      when the condition of the matrix is large

SMatrix<T,D1,D2,R> InverseFast(int& ifail) const
      Invert a square Matrix and  returns a new matrix. In case the inversion fails
      the current matrix is returned.
      \param ifail . ifail will be set to 0 when inversion is successfull.
      See ROOT::Math::SMatrix::InvertFast for the inversion algorithm

bool InvertChol()
      Invertion of a symmetric positive defined Matrix using Choleski decomposition.
      ( this method changes the current matrix).
      Return true if inversion is successfull.
      The method used is based on Choleski decomposition
      A compile error is given if the matrix is not of type symmetric and a run-time failure if the
      matrix is not positive defined.
      For solving  a linear system, it is possible to use also the function
      ROOT::Math::SolveChol(matrix, vector) which will be faster than performing the inversion

SMatrix<T,D1,D2,R> InverseChol(int& ifail) const
      Invert of a symmetric positive defined Matrix using Choleski decomposition.
      A compile error is given if the matrix is not of type symmetric and a run-time failure if the
      matrix is not positive defined.
      In case the inversion fails the current matrix is returned.
      \param ifail . ifail will be set to 0 when inversion is successfull.
      See ROOT::Math::SMatrix::InvertChol for the inversion algorithm

bool Det(Double32_t& det)
      determinant of square Matrix via Dfact.
      Return true when the calculation is successfull.
      \param det will contain the calculated determinant value
      \b Note: this will destroy the contents of the Matrix!

bool Det2(Double32_t& det) const
      determinant of square Matrix via Dfact.
      Return true when the calculation is successfull.
      \param det will contain the calculated determinant value
      \b Note: this will preserve the content of the Matrix!

SVector<T,D2> Row(unsigned int therow) const
      return a full Matrix row as a vector (copy the content in a new vector)

SVector<T,D1> Col(unsigned int thecol) const
      return a full Matrix column as a vector (copy the content in a new vector)

SVector<T,D1> Diagonal() const
      return diagonal elements of a matrix as a Vector.
      It works only for squared matrices D1 == D2, otherwise it will produce a compile error

T Trace() const
      return the trace of a matrix
      Sum of the diagonal elements

SubVector UpperBlock() const
SubVector LowerBlock() const
bool IsInUse(const Double32_t* p) const
 @name --- Other Functions --- 

       Function to check if a matrix is sharing same memory location of the passed pointer
       This function is used by the expression templates to avoid the alias problem during
       expression evaluation. When  the matrix is in use, for example in operations
       like A = B * A, a temporary object storing the intermediate result is automatically
       created when evaluating the expression.


std::ostream& Print(ostream& os) const
 submatrices
 Print: used by operator<<()