C++ mpi module for stochmagnet_main Package
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
SM_PackedBlockGeneralMatrix< T, P > Class Template Reference

This class described a matrix by packed symmetric block of size NxP in a row storage. More...

#include <SM_PackedBlockGeneralMatrix.h>

Inheritance diagram for SM_PackedBlockGeneralMatrix< T, P >:
Inheritance graph
[legend]
Collaboration diagram for SM_PackedBlockGeneralMatrix< T, P >:
Collaboration graph
[legend]

Public Member Functions

virtual tMemSize getMemorySize () const
 return the memory size of the class and the memory size of all its attributes/associations More...
 
virtual tMemSize getContentsMemorySize () const
 return the memory size of the included associations More...
 
virtual void reset () final
 reset the values
 
virtual void setSize (const tIndex &nRowBlocks, const tIndex &nColBlocks) final
 set the number or rows & columns of the blocks matrix
 
virtual void setValue (const tIndex &i, const tIndex &j, const T &v) final
 set values at row i and column j More...
 
virtual const T & getValue (const tIndex &i, const tIndex &j) const final
 get values at row i and column j for reading More...
 
virtual T & getValue (const tIndex &i, const tIndex &j) final
 get values at row i and column j for writing More...
 
std::valarray< T > & getBlocksValues ()
 get the values of superior blocks of the matrix
 
const std::valarray< T > & getBlocksValues () const
 get the values of superior blocks of the matrix
 
const T & operator() (tIndex i, tIndex j) const
 get values at row i and column j for reading More...
 
T & operator() (tIndex i, tIndex j)
 get values at row i and column j for writing More...
 
virtual void vectorProduct (const T *vX, T *vY) const
 vector product More...
 
virtual tString toString () const override
 return string representaton of the operator
 
- Public Member Functions inherited from SM_PackedBlockMatrix< T, P >
virtual void setSize (const tInteger &nRowBlocks, const tInteger &nColBlocks)
 set the number or rows & columns of the blocks matrix More...
 
const tInteger & getRowBlocksNumber () const
 get the number of row blowks
 
const tInteger & getColumnBlocksNumber () const
 get the number of column blocks
 
- Public Member Functions inherited from CORE_Object
template<class T >
std::shared_ptr< T > getSharedPointer ()
 return the shared pointer for this More...
 
template<class T >
std::shared_ptr< const T > getConstSharedPointer () const
 return a const shared pointer for this More...
 
template<class T >
tBoolean isInstanceOf () const
 test if the clas T is an instance of this class More...
 
tString getClassName () const
 return the name of the class More...
 
tString getPointerString () const
 retrun the pointer of the class as a string More...
 
tString getIdentityString () const
 retrun the string identification of the class More...
 

Static Public Member Functions

static CORE_UniquePointer< SelfClassNew ()
 build a new instance of the operator More...
 
- Static Public Member Functions inherited from CORE_Object
static tBoolean EnableMemoryStack (const tBoolean &isMemoryChecked)
 enable the memory stack More...
 
static void EnableMemoryStack ()
 enable the memory stack
 
static void DisableMemoryStack ()
 disable the memory stack
 
static tBoolean IsMemoryStackEnabled ()
 return trur if the memory stack is enabled
 
static tString MemoryStackToString ()
 get the memory stack in string More...
 
static tIndex GetRegisteredClassesNumber ()
 get the memory stack in string More...
 

Protected Member Functions

 SM_PackedBlockGeneralMatrix (void)
 create a matrix of size 0
 
virtual ~SM_PackedBlockGeneralMatrix (void)
 destroy
 
- Protected Member Functions inherited from SM_PackedBlockMatrix< T, P >
 SM_PackedBlockMatrix (void)
 create a matrix of size 0
 
virtual ~SM_PackedBlockMatrix (void)
 destroy
 
- Protected Member Functions inherited from CORE_Object
 CORE_Object ()
 build an instance of the object
 
virtual ~CORE_Object ()
 destroy the instance of object std

 

Additional Inherited Members

- Static Public Attributes inherited from SM_PackedBlockMatrix< T, P >
static constexpr tUCInt BLOCK_SIZE =P*(P+1)/2
 size of the block in packed storage with diagonal
 
- Static Protected Member Functions inherited from SM_PackedBlockMatrix< T, P >
static tIndex GetPackedIndex (const tIndex &i, const tIndex &j)
 return the pack index of size Q in a column storage More...
 
static void BlockVectorProduct (const T *B, const T *X, T *Y, const T *eY, const T *Xi, const T *Xj, T *Yi, T *Yj)
 compute sthe vector product of the packed symmetric block B of dimension P by X to obtain Y=B.X More...
 

Detailed Description

template<typename T, tUCInt P>
class SM_PackedBlockGeneralMatrix< T, P >

This class described a matrix by packed symmetric block of size NxP in a row storage.

Template Parameters
T: type of the element of the block of the matrix
P: size of the block \( P \times P \)
Author
Stephane Despreaux
Version
2.0

Member Function Documentation

◆ getContentsMemorySize()

template<typename T , tUCInt P>
virtual tMemSize SM_PackedBlockGeneralMatrix< T, P >::getContentsMemorySize ( ) const
inlinevirtual

return the memory size of the included associations

Returns
the memory size of the storage in bytes 1 Kb = 1024 bytes 1 Mb = 1024 Kb 1 Gb = 1024 Mb 1 Tb = 1024 Gb 1 Hb = 1024 Tb

Reimplemented from SM_PackedBlockMatrix< T, P >.

◆ getMemorySize()

template<typename T , tUCInt P>
virtual tMemSize SM_PackedBlockGeneralMatrix< T, P >::getMemorySize ( ) const
inlinevirtual

return the memory size of the class and the memory size of all its attributes/associations

Returns
the memory size of the class and the memory size of its attributes/associations in bytes The mamory size is :
  • the added size of the base classes which contains:
    • the primary attributes size depends on the order: (first delare the smallest attributes size
    • all virtual functions costs <pointer-size> (4 32xor 8 64x) bytes by virtual function
    • virtual inherihtance will increase of (4 or 8) bytes
  • we add the size of the contains values of the attributes : for example the size of a string is the length of the string 1 octet = 1 byte 1 Ko = 1024 bytes 1 Mo = 1024 Ko 1 Go = 1024 Mo

Reimplemented from SM_PackedBlockMatrix< T, P >.

◆ getValue() [1/2]

template<typename T , tUCInt P>
virtual const T& SM_PackedBlockGeneralMatrix< T, P >::getValue ( const tIndex &  i,
const tIndex &  j 
) const
inlinefinalvirtual

get values at row i and column j for reading

Parameters
[in]i: index of the row i in [0,nRowBlocks x P[
[in]jindex of the column j in [ [0,nCollocks x P[ return value at index i,j

Implements SM_PackedBlockMatrix< T, P >.

◆ getValue() [2/2]

template<typename T , tUCInt P>
virtual T& SM_PackedBlockGeneralMatrix< T, P >::getValue ( const tIndex &  i,
const tIndex &  j 
)
inlinefinalvirtual

get values at row i and column j for writing

Parameters
[in]i: index of the row i in [0,nRowBlocks x P[
[in]jindex of the column j in [ [0,nCollocks x P[ return value at index i,j

Implements SM_PackedBlockMatrix< T, P >.

◆ New()

template<typename T , tUCInt P>
static CORE_UniquePointer<SelfClass> SM_PackedBlockGeneralMatrix< T, P >::New ( )
inlinestatic

build a new instance of the operator

Returns
an unique pointer of the operator

◆ operator()() [1/2]

template<typename T , tUCInt P>
T& SM_PackedBlockGeneralMatrix< T, P >::operator() ( tIndex  i,
tIndex  j 
)
inline

get values at row i and column j for writing

Parameters
[in]i: index of the row i in [0,nRowBlocks x P[
[in]jindex of the column j in [ [0,nCollocks x P[ return value at index i,j

◆ operator()() [2/2]

template<typename T , tUCInt P>
const T& SM_PackedBlockGeneralMatrix< T, P >::operator() ( tIndex  i,
tIndex  j 
) const
inline

get values at row i and column j for reading

Parameters
[in]i: index of the row i in [0,nRowBlocks x P[
[in]jindex of the column j in [ [0,nCollocks x P[ return value at index i,j

◆ setValue()

template<typename T , tUCInt P>
virtual void SM_PackedBlockGeneralMatrix< T, P >::setValue ( const tIndex &  i,
const tIndex &  j,
const T &  v 
)
inlinefinalvirtual

set values at row i and column j

Parameters
[in]i: index of the row i in [0,nRowBlocks x P[
[in]jindex of the column j in [ [0,nCollocks x P[
[in]v: value

Implements SM_PackedBlockMatrix< T, P >.

◆ vectorProduct()

template<typename T , tUCInt P>
void SM_PackedBlockGeneralMatrix< T, P >::vectorProduct ( const T *  vX,
T *  vY 
) const
virtual

vector product

Parameters
[in]vXvalues of X vector
[out]vY: values of return vector Y=A.X

Implements SM_PackedBlockMatrix< T, P >.


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