SOFA plugin: MultiThreading  master
Open source framework for multi-physics simuation
multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy > Class Template Reference

#include <ParallelCompressedRowSparseMatrixMechanical.h>

Inheritance diagram for multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >:

Detailed Description

template<typename TBlock, typename TPolicy = CRSMechanicalPolicy>
class multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >

Simplified equivalent of CompressedRowSparseMatrixMechanical where some methods are multithreaded.

Static Public Attributes

static constexpr sofa::Index NL = Base::NL
 
static constexpr sofa::Index NC = Base::NC
 

Public Member Functions

Index rowSize () const override
 
Index colSize () const override
 
void clearRowCol (Index i) override
 
void clearRow (Index i) override
 
void clearCol (Index i) override
 
void set (Index i, Index j, double v) override
 
Index rowBSize () const
 
template<class V1 , class V2 >
void tmul (V1 &res, const V2 &vec) const
 
template<class Vec >
Vec operator* (const Vec &v) const
 
SReal element (BaseMatrix::Index i, BaseMatrix::Index j) const override
 
void resize (BaseMatrix::Index nbRow, BaseMatrix::Index nbCol) override
 
void clear () override
 
void add (BaseMatrix::Index row, BaseMatrix::Index col, double v) override
 
void add (Index row, Index col, const sofa::type::Mat3x3d &_M) override
 
void add (Index row, Index col, const sofa::type::Mat3x3f &_M) override
 
void add (Index row, Index col, const sofa::type::Mat2x2d &_M) override
 
void add (Index row, Index col, const sofa::type::Mat2x2f &_M) override
 
void setTaskScheduler (sofa::simulation::TaskScheduler *taskScheduler)
 
- Public Member Functions inherited from sofa::linearalgebra::BaseMatrix
 BaseMatrix ()
 
virtual ~BaseMatrix ()
 
Index rows (void) const
 
Index cols (void) const
 
virtual SReal element (Index i, Index j) const=0
 
SReal operator() (Index i, Index j) const
 
virtual void resize (Index nbRow, Index nbCol)=0
 
virtual void set (Index i, Index j, double v)=0
 
virtual void add (Index row, Index col, double v)=0
 
virtual void add (Index row, Index col, const type::Mat3x3d &_M)
 
virtual void add (Index row, Index col, const type::Mat3x3f &_M)
 
virtual void add (Index row, Index col, const type::Mat2x2d &_M)
 
virtual void add (Index row, Index col, const type::Mat2x2f &_M)
 
virtual void add (Index row, Index col, const type::Mat6x6d &_M)
 
virtual void add (Index row, Index col, const type::Mat6x6f &_M)
 
virtual void clear (Index i, Index j)
 
virtual void clearRow (Index i)
 
virtual void clearRows (Index imin, Index imax)
 
virtual void clearCol (Index j)
 
virtual void clearCols (Index imin, Index imax)
 
virtual void clearRowCol (Index i)
 
virtual void clearRowsCols (Index imin, Index imax)
 
virtual void compress ()
 
virtual void opMulV (linearalgebra::BaseVector *result, const linearalgebra::BaseVector *v) const
 
virtual void opMulV (float *result, const float *v) const
 
virtual void opMulV (double *result, const double *v) const
 
virtual void opPMulV (linearalgebra::BaseVector *result, const linearalgebra::BaseVector *v) const
 
virtual void opPMulV (float *result, const float *v) const
 
virtual void opPMulV (double *result, const double *v) const
 
virtual void opMulTV (linearalgebra::BaseVector *result, const linearalgebra::BaseVector *v) const
 
virtual void opMulTV (float *result, const float *v) const
 
virtual void opMulTV (double *result, const double *v) const
 
virtual void opPMulTV (linearalgebra::BaseVector *result, const linearalgebra::BaseVector *v) const
 
virtual void opPMulTV (float *result, const float *v) const
 
virtual void opPMulTV (double *result, const double *v) const
 
virtual void opMulTM (BaseMatrix *result, BaseMatrix *m) const
 
virtual void opAddM (linearalgebra::BaseMatrix *m, double fact) const
 
virtual void opAddMT (linearalgebra::BaseMatrix *m, double fact) const
 
virtual ElementType getElementType () const
 
virtual std::size_t getElementSize () const
 
virtual MatrixCategory getCategory () const
 
virtual Index getBlockRows () const
 
virtual Index getBlockCols () const
 
virtual Index bRowSize () const
 
virtual Index bColSize () const
 
virtual Index getBandWidth () const
 
bool isDiagonal () const
 
bool isBlockDiagonal () const
 
bool isBand () const
 
bool isSparse () const
 
virtual BlockConstAccessor blocGet (Index i, Index j) const
 
virtual BlockAccessor blocGetW (Index i, Index j)
 
virtual BlockAccessor blocCreate (Index i, Index j)
 
const T * blocElements (Index i, Index j, T *buffer) const
 
void blocSet (Index i, Index j, const T *buffer)
 
void blocAdd (Index i, Index j, const T *buffer)
 
virtual ColBlockConstIterator bRowBegin (Index ib) const
 
virtual ColBlockConstIterator bRowEnd (Index ib) const
 
virtual std::pair< ColBlockConstIterator, ColBlockConstIteratorbRowRange (Index ib) const
 
virtual RowBlockConstIterator bRowsBegin () const
 
virtual RowBlockConstIterator bRowsEnd () const
 
virtual std::pair< RowBlockConstIterator, RowBlockConstIteratorbRowsRange () const
 
virtual void opMulV (linearalgebra::BaseVector *result, const linearalgebra::BaseVector *v) const
 
virtual void opMulV (float *result, const float *v) const
 
virtual void opMulV (double *result, const double *v) const
 
virtual void opPMulV (linearalgebra::BaseVector *result, const linearalgebra::BaseVector *v) const
 
virtual void opPMulV (float *result, const float *v) const
 
virtual void opPMulV (double *result, const double *v) const
 
virtual void opMulTV (linearalgebra::BaseVector *result, const linearalgebra::BaseVector *v) const
 
virtual void opMulTV (float *result, const float *v) const
 
virtual void opMulTV (double *result, const double *v) const
 
virtual void opPMulTV (linearalgebra::BaseVector *result, const linearalgebra::BaseVector *v) const
 
virtual void opPMulTV (float *result, const float *v) const
 
virtual void opPMulTV (double *result, const double *v) const
 
virtual void opMulTM (BaseMatrix *result, BaseMatrix *m) const
 
virtual void opAddM (linearalgebra::BaseMatrix *m, double fact) const
 
virtual void opAddMT (linearalgebra::BaseMatrix *m, double fact) const
 

Static Public Member Functions

static const char * Name ()
 
template<class Vec >
static void vresize (Vec &vec, Index, Index totalSize)
 
template<class Vec >
static void vresize (sofa::type::vector< Vec > &vec, Index blockSize, Index)
 
template<class Vec >
static Real vget (const Vec &vec, Index i, Index j, Index k)
 
template<class Vec >
static Real vget (const sofa::type::vector< Vec > &vec, Index i, Index, Index k)
 
static Real vget (const sofa::linearalgebra::BaseVector &vec, Index i)
 
template<class Real2 >
static Real2 vget (const sofa::linearalgebra::FullVector< Real2 > &vec, Index i)
 
template<class Vec >
static void vset (Vec &vec, Index i, Index j, Index k, Real v)
 
template<class Vec >
static void vset (sofa::type::vector< Vec > &vec, Index i, Index, Index k, Real v)
 
static void vset (sofa::linearalgebra::BaseVector &vec, Index i, Real v)
 
template<class Real2 >
static void vset (sofa::linearalgebra::FullVector< Real2 > &vec, Index i, Real2 v)
 

Additional Inherited Members

- Public Attributes inherited from sofa::linearalgebra::BaseMatrix
 ELEMENT_UNKNOWN
 
 ELEMENT_FLOAT
 
 ELEMENT_INT
 
 MATRIX_UNKNOWN
 
 MATRIX_IDENTITY
 
 MATRIX_DIAGONAL
 
 MATRIX_BAND
 
 MATRIX_SPARSE
 
 MATRIX_FULL
 
- Protected Member Functions inherited from sofa::linearalgebra::BaseMatrix
virtual void bAccessorDelete (const InternalBlockAccessor *) const
 
virtual void bAccessorCopy (InternalBlockAccessor *) const
 
virtual SReal bAccessorElement (const InternalBlockAccessor *b, Index i, Index j) const
 
virtual void bAccessorSet (InternalBlockAccessor *b, Index i, Index j, double v)
 
virtual void bAccessorAdd (InternalBlockAccessor *b, Index i, Index j, double v)
 
const T * bAccessorElementsDefaultImpl (const InternalBlockAccessor *b, T *buffer) const
 
virtual const float * bAccessorElements (const InternalBlockAccessor *b, float *buffer) const
 
virtual const double * bAccessorElements (const InternalBlockAccessor *b, double *buffer) const
 
virtual const int * bAccessorElements (const InternalBlockAccessor *b, int *buffer) const
 
void bAccessorSetDefaultImpl (InternalBlockAccessor *b, const T *buffer)
 
virtual void bAccessorSet (InternalBlockAccessor *b, const float *buffer)
 
virtual void bAccessorSet (InternalBlockAccessor *b, const double *buffer)
 
virtual void bAccessorSet (InternalBlockAccessor *b, const int *buffer)
 
void bAccessorAddDefaultImpl (InternalBlockAccessor *b, const T *buffer)
 
virtual void bAccessorAdd (InternalBlockAccessor *b, const float *buffer)
 
virtual void bAccessorAdd (InternalBlockAccessor *b, const double *buffer)
 
virtual void bAccessorAdd (InternalBlockAccessor *b, const int *buffer)
 
T * bAccessorPrepareAddDefaultImpl (InternalBlockAccessor *, T *buffer)
 
virtual float * bAccessorPrepareAdd (InternalBlockAccessor *b, float *buffer)
 
virtual double * bAccessorPrepareAdd (InternalBlockAccessor *b, double *buffer)
 
virtual int * bAccessorPrepareAdd (InternalBlockAccessor *b, int *buffer)
 
virtual void bAccessorFinishAdd (InternalBlockAccessor *b, const float *buffer)
 
virtual void bAccessorFinishAdd (InternalBlockAccessor *b, const double *buffer)
 
virtual void bAccessorFinishAdd (InternalBlockAccessor *b, const int *buffer)
 
BlockAccessor createBlockAccessor (Index row, Index col, void *internalPtr=nullptr)
 
BlockAccessor createBlockAccessor (Index row, Index col, Index internalData)
 
BlockConstAccessor createBlockConstAccessor (Index row, Index col, void *internalPtr=nullptr) const
 
BlockConstAccessor createBlockConstAccessor (Index row, Index col, Index internalData) const
 
void setMatrix (BlockAccessor *b)
 
void setMatrix (BlockConstAccessor *b) const
 
virtual void itCopyColBlock (InternalColBlockIterator *) const
 
virtual void itDeleteColBlock (const InternalColBlockIterator *) const
 
virtual void itAccessColBlock (InternalColBlockIterator *it, BlockConstAccessor *b) const
 
virtual void itIncColBlock (InternalColBlockIterator *it) const
 
virtual void itDecColBlock (InternalColBlockIterator *it) const
 
virtual bool itEqColBlock (const InternalColBlockIterator *it, const InternalColBlockIterator *it2) const
 
virtual bool itLessColBlock (const InternalColBlockIterator *it, const InternalColBlockIterator *it2) const
 
ColBlockConstIterator createColBlockConstIterator (Index row, void *internalPtr) const
 
ColBlockConstIterator createColBlockConstIterator (Index row, Index internalData) const
 
virtual void itCopyRowBlock (InternalRowBlockIterator *) const
 
virtual void itDeleteRowBlock (const InternalRowBlockIterator *) const
 
virtual Index itAccessRowBlock (InternalRowBlockIterator *it) const
 
virtual ColBlockConstIterator itBeginRowBlock (InternalRowBlockIterator *it) const
 
virtual ColBlockConstIterator itEndRowBlock (InternalRowBlockIterator *it) const
 
virtual std::pair< ColBlockConstIterator, ColBlockConstIteratoritRangeRowBlock (InternalRowBlockIterator *it) const
 
virtual void itIncRowBlock (InternalRowBlockIterator *it) const
 
virtual void itDecRowBlock (InternalRowBlockIterator *it) const
 
virtual bool itEqRowBlock (const InternalRowBlockIterator *it, const InternalRowBlockIterator *it2) const
 
virtual bool itLessRowBlock (const InternalRowBlockIterator *it, const InternalRowBlockIterator *it2) const
 
RowBlockConstIterator createRowBlockConstIterator (void *internalPtr) const
 
RowBlockConstIterator createRowBlockConstIterator (Index internalData0, Index internalData1) const
 
- Static Protected Member Functions inherited from sofa::linearalgebra::BaseMatrix
static InternalBlockAccessorgetInternal (BlockConstAccessor *b)
 
static const InternalBlockAccessorgetInternal (const BlockConstAccessor *b)
 
static InternalBlockAccessorgetInternal (BlockAccessor *b)
 
static const InternalBlockAccessorgetInternal (const BlockAccessor *b)
 
static InternalColBlockIteratorgetInternal (ColBlockConstIterator *b)
 
static const InternalColBlockIteratorgetInternal (const ColBlockConstIterator *b)
 
static InternalRowBlockIteratorgetInternal (RowBlockConstIterator *b)
 
static const InternalRowBlockIteratorgetInternal (const RowBlockConstIterator *b)
 

Attribute details

◆ NC

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
constexpr sofa::Index multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::NC = Base::NC
staticconstexpr

◆ NL

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
constexpr sofa::Index multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::NL = Base::NL
staticconstexpr

Function details

◆ add() [1/5]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::add ( BaseMatrix::Index  row,
BaseMatrix::Index  col,
double  v 
)
inlineoverride

◆ add() [2/5]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::add ( Index  row,
Index  col,
const sofa::type::Mat2x2d _M 
)
inlineoverride

◆ add() [3/5]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::add ( Index  row,
Index  col,
const sofa::type::Mat2x2f _M 
)
inlineoverride

◆ add() [4/5]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::add ( Index  row,
Index  col,
const sofa::type::Mat3x3d _M 
)
inlineoverride

◆ add() [5/5]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::add ( Index  row,
Index  col,
const sofa::type::Mat3x3f _M 
)
inlineoverride

◆ clear()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::clear ( )
inlineoverridevirtual

◆ clearCol()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::clearCol ( Index  i)
inlineoverride

◆ clearRow()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::clearRow ( Index  i)
inlineoverride

◆ clearRowCol()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::clearRowCol ( Index  i)
inlineoverride

◆ colSize()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
Index multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::colSize ( void  ) const
inlineoverridevirtual

◆ element()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
SReal multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::element ( BaseMatrix::Index  i,
BaseMatrix::Index  j 
) const
inlineoverride

◆ Name()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
static const char* multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::Name ( )
inlinestatic

◆ operator*()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Vec >
Vec multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::operator* ( const Vec &  v) const
inline

◆ resize()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::resize ( BaseMatrix::Index  nbRow,
BaseMatrix::Index  nbCol 
)
inlineoverride

◆ rowBSize()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
Index multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::rowBSize ( ) const
inline

◆ rowSize()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
Index multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::rowSize ( void  ) const
inlineoverridevirtual

◆ set()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::set ( Index  i,
Index  j,
double  v 
)
inlineoverride

◆ setTaskScheduler()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::setTaskScheduler ( sofa::simulation::TaskScheduler taskScheduler)
inline

◆ tmul()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class V1 , class V2 >
void multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::tmul ( V1 &  res,
const V2 &  vec 
) const
inline

◆ vget() [1/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
static Real multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vget ( const sofa::linearalgebra::BaseVector vec,
Index  i 
)
inlinestatic

◆ vget() [2/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Real2 >
static Real2 multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vget ( const sofa::linearalgebra::FullVector< Real2 > &  vec,
Index  i 
)
inlinestatic

◆ vget() [3/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Vec >
static Real multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vget ( const sofa::type::vector< Vec > &  vec,
Index  i,
Index  ,
Index  k 
)
inlinestatic

◆ vget() [4/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Vec >
static Real multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vget ( const Vec &  vec,
Index  i,
Index  j,
Index  k 
)
inlinestatic

◆ vresize() [1/2]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Vec >
static void multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vresize ( sofa::type::vector< Vec > &  vec,
Index  blockSize,
Index   
)
inlinestatic

◆ vresize() [2/2]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Vec >
static void multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vresize ( Vec &  vec,
Index  ,
Index  totalSize 
)
inlinestatic

◆ vset() [1/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
static void multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vset ( sofa::linearalgebra::BaseVector vec,
Index  i,
Real  v 
)
inlinestatic

◆ vset() [2/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Real2 >
static void multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vset ( sofa::linearalgebra::FullVector< Real2 > &  vec,
Index  i,
Real2  v 
)
inlinestatic

◆ vset() [3/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Vec >
static void multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vset ( sofa::type::vector< Vec > &  vec,
Index  i,
Index  ,
Index  k,
Real  v 
)
inlinestatic

◆ vset() [4/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Vec >
static void multithreading::component::linearsolver::iterative::ParallelCompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vset ( Vec &  vec,
Index  i,
Index  j,
Index  k,
Real  v 
)
inlinestatic