1 #ifndef SM_PackedBlockMatrix_H
2 #define SM_PackedBlockMatrix_H
5 #include "CORE_Object.h"
17 template<
typename T,tUCInt P>
35 tInteger mRowBlocksNumber;
36 tInteger mColumnBlocksNumber;
53 mColumnBlocksNumber=0;
112 virtual void setSize(
const tInteger& nRowBlocks,
const tInteger& nColBlocks) {
113 mRowBlocksNumber=nRowBlocks;
114 mColumnBlocksNumber=nColBlocks;
120 return mRowBlocksNumber;
125 return mColumnBlocksNumber;
132 virtual void setValue(
const tIndex& i,
const tIndex& j,
const T& v)=0;
139 virtual const T&
getValue(
const tIndex& i,
const tIndex& j)
const=0;
146 virtual T&
getValue(
const tIndex& i,
const tIndex& j)=0;
191 const T* Xi,
const T* Xj,T* Yi,T* Yj) {
237 std::stringstream ret;
239 ret<<
"block size:"<<P<<
"\n";
240 ret<<
"Rows number:"<<mRowBlocksNumber<<
"\n";
241 ret<<
"Columns number:"<<mColumnBlocksNumber<<
"\n";
abstract base class for most classes.
Definition: CORE_Object.h:65
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: CORE_Object.h:278
virtual tString toString() const
return the string representation of the object node
Definition: CORE_Object.h:333
This class described a matrix by packed block of size in a row storage.
Definition: SM_PackedBlockMatrix.h:18
virtual tString toString() const override
return string representaton of the operator
Definition: SM_PackedBlockMatrix.h:236
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....
Definition: SM_PackedBlockMatrix.h:188
virtual T & getValue(const tIndex &i, const tIndex &j)=0
get values at row i and column j for writing
virtual void reset()=0
reset the values
virtual ~SM_PackedBlockMatrix(void)
destroy
Definition: SM_PackedBlockMatrix.h:59
const tInteger & getColumnBlocksNumber() const
get the number of column blocks
Definition: SM_PackedBlockMatrix.h:124
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_PackedBlockMatrix.h:82
virtual void setValue(const tIndex &i, const tIndex &j, const T &v)=0
set values at row i and column j
virtual void setSize(const tInteger &nRowBlocks, const tInteger &nColBlocks)
set the number or rows & columns of the blocks matrix
Definition: SM_PackedBlockMatrix.h:112
virtual const T & getValue(const tIndex &i, const tIndex &j) const =0
get values at row i and column j for reading
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_PackedBlockMatrix.h:94
SM_PackedBlockMatrix(void)
create a matrix of size 0
Definition: SM_PackedBlockMatrix.h:51
static tIndex GetPackedIndex(const tIndex &i, const tIndex &j)
return the pack index of size Q in a column storage
Definition: SM_PackedBlockMatrix.h:165
virtual void vectorProduct(const T *vX, T *vY) const =0
vector product
static constexpr tUCInt BLOCK_SIZE
size of the block in packed storage with diagonal
Definition: SM_PackedBlockMatrix.h:23
const tInteger & getRowBlocksNumber() const
get the number of row blowks
Definition: SM_PackedBlockMatrix.h:119