Logo ROOT  
Reference Guide
ROOT::Math::MatRepSym< T, D > Class Template Reference

template<class T, unsigned int D>
class ROOT::Math::MatRepSym< T, D >

MatRepSym Matrix storage representation for a symmetric matrix of dimension NxN This class is a template on the contained type and on the symmetric matrix size, N.

It has as data member an array of type T of size N*(N+1)/2, containing the lower diagonal block of the matrix. The order follows the lower diagonal block, still in a row-major convention. For example for a symmetric 3x3 matrix the order of the 6 elements \( \left[a_0,a_1.....a_5 \right]\) is:

\[ 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) \]

Definition at line 213 of file MatrixRepresentationsStatic.h.

Public Types

enum  { kRows = D, kCols = D, kSize = D*(D+1)/2 }
 
typedef T value_type
 

Public Member Functions

 MatRepSym ()
 
apply (unsigned int i) const
 
T * Array ()
 
const T * Array () const
 
T & operator() (unsigned int i, unsigned int j)
 
T const & operator() (unsigned int i, unsigned int j) const
 
MatRepSym< T, D > & operator+= (const MatRepSym &rhs)
 
template<class R >
MatRepSym< T, D > & operator+= (const R &)
 self addition : only symmetric to symmetric allowed More...
 
MatRepSym< T, D > & operator-= (const MatRepSym &rhs)
 
template<class R >
MatRepSym< T, D > & operator-= (const R &)
 self subtraction : only symmetric to symmetric allowed More...
 
MatRepSym< T, D > & operator= (const MatRepSym &rhs)
 
template<class R >
MatRepSym< T, D > & operator= (const R &)
 assignment : only symmetric to symmetric allowed More...
 
template<class R >
bool operator== (const R &rhs) const
 
T & operator[] (unsigned int i)
 
T const & operator[] (unsigned int i) const
 

Static Public Member Functions

static int off (int i)
 
static constexpr int off0 (int i)
 
static constexpr int off1 (int i)
 
static constexpr int off2 (int i, int j)
 
static constexpr unsigned int offset (unsigned int i, unsigned int j)
 

Private Attributes

fArray [kSize]
 

#include <Math/MatrixRepresentationsStatic.h>

Member Typedef Documentation

◆ value_type

template<class T , unsigned int D>
typedef T ROOT::Math::MatRepSym< T, D >::value_type

Definition at line 219 of file MatrixRepresentationsStatic.h.

Member Enumeration Documentation

◆ anonymous enum

template<class T , unsigned int D>
anonymous enum
Enumerator
kRows 

return no. of matrix rows

kCols 

return no. of matrix columns

kSize 

return no of elements: rows*columns

Definition at line 294 of file MatrixRepresentationsStatic.h.

Constructor & Destructor Documentation

◆ MatRepSym()

template<class T , unsigned int D>
ROOT::Math::MatRepSym< T, D >::MatRepSym ( )
inline

Definition at line 217 of file MatrixRepresentationsStatic.h.

Member Function Documentation

◆ apply()

template<class T , unsigned int D>
T ROOT::Math::MatRepSym< T, D >::apply ( unsigned int  i) const
inline

Definition at line 236 of file MatrixRepresentationsStatic.h.

◆ Array() [1/2]

template<class T , unsigned int D>
T* ROOT::Math::MatRepSym< T, D >::Array ( )
inline

Definition at line 240 of file MatrixRepresentationsStatic.h.

◆ Array() [2/2]

template<class T , unsigned int D>
const T* ROOT::Math::MatRepSym< T, D >::Array ( ) const
inline

Definition at line 242 of file MatrixRepresentationsStatic.h.

◆ off()

template<class T , unsigned int D>
static int ROOT::Math::MatRepSym< T, D >::off ( int  i)
inlinestatic

Definition at line 307 of file MatrixRepresentationsStatic.h.

◆ off0()

template<class T , unsigned int D>
static constexpr int ROOT::Math::MatRepSym< T, D >::off0 ( int  i)
inlinestaticconstexpr

Definition at line 303 of file MatrixRepresentationsStatic.h.

◆ off1()

template<class T , unsigned int D>
static constexpr int ROOT::Math::MatRepSym< T, D >::off1 ( int  i)
inlinestaticconstexpr

Definition at line 305 of file MatrixRepresentationsStatic.h.

◆ off2()

template<class T , unsigned int D>
static constexpr int ROOT::Math::MatRepSym< T, D >::off2 ( int  i,
int  j 
)
inlinestaticconstexpr

Definition at line 304 of file MatrixRepresentationsStatic.h.

◆ offset()

template<class T , unsigned int D>
static constexpr unsigned int ROOT::Math::MatRepSym< T, D >::offset ( unsigned int  i,
unsigned int  j 
)
inlinestaticconstexpr

Definition at line 313 of file MatrixRepresentationsStatic.h.

◆ operator()() [1/2]

template<class T , unsigned int D>
T& ROOT::Math::MatRepSym< T, D >::operator() ( unsigned int  i,
unsigned int  j 
)
inline

Definition at line 222 of file MatrixRepresentationsStatic.h.

◆ operator()() [2/2]

template<class T , unsigned int D>
T const& ROOT::Math::MatRepSym< T, D >::operator() ( unsigned int  i,
unsigned int  j 
) const
inline

Definition at line 225 of file MatrixRepresentationsStatic.h.

◆ operator+=() [1/2]

template<class T , unsigned int D>
MatRepSym<T, D>& ROOT::Math::MatRepSym< T, D >::operator+= ( const MatRepSym< T, D > &  rhs)
inline

Definition at line 267 of file MatrixRepresentationsStatic.h.

◆ operator+=() [2/2]

template<class T , unsigned int D>
template<class R >
MatRepSym<T, D>& ROOT::Math::MatRepSym< T, D >::operator+= ( const R )
inline

self addition : only symmetric to symmetric allowed

Definition at line 262 of file MatrixRepresentationsStatic.h.

◆ operator-=() [1/2]

template<class T , unsigned int D>
MatRepSym<T, D>& ROOT::Math::MatRepSym< T, D >::operator-= ( const MatRepSym< T, D > &  rhs)
inline

Definition at line 281 of file MatrixRepresentationsStatic.h.

◆ operator-=() [2/2]

template<class T , unsigned int D>
template<class R >
MatRepSym<T, D>& ROOT::Math::MatRepSym< T, D >::operator-= ( const R )
inline

self subtraction : only symmetric to symmetric allowed

Definition at line 276 of file MatrixRepresentationsStatic.h.

◆ operator=() [1/2]

template<class T , unsigned int D>
MatRepSym<T, D>& ROOT::Math::MatRepSym< T, D >::operator= ( const MatRepSym< T, D > &  rhs)
inline

Definition at line 253 of file MatrixRepresentationsStatic.h.

◆ operator=() [2/2]

template<class T , unsigned int D>
template<class R >
MatRepSym<T, D>& ROOT::Math::MatRepSym< T, D >::operator= ( const R )
inline

assignment : only symmetric to symmetric allowed

Definition at line 248 of file MatrixRepresentationsStatic.h.

◆ operator==()

template<class T , unsigned int D>
template<class R >
bool ROOT::Math::MatRepSym< T, D >::operator== ( const R rhs) const
inline

Definition at line 286 of file MatrixRepresentationsStatic.h.

◆ operator[]() [1/2]

template<class T , unsigned int D>
T& ROOT::Math::MatRepSym< T, D >::operator[] ( unsigned int  i)
inline

Definition at line 228 of file MatrixRepresentationsStatic.h.

◆ operator[]() [2/2]

template<class T , unsigned int D>
T const& ROOT::Math::MatRepSym< T, D >::operator[] ( unsigned int  i) const
inline

Definition at line 232 of file MatrixRepresentationsStatic.h.

Member Data Documentation

◆ fArray

template<class T , unsigned int D>
T ROOT::Math::MatRepSym< T, D >::fArray[kSize]
private

Definition at line 322 of file MatrixRepresentationsStatic.h.

Libraries for ROOT::Math::MatRepSym< T, D >:
[legend]

The documentation for this class was generated from the following files: