SOFA API  1a4bb3e7
Open source framework for multi-physics simuation
sofa::linearalgebra::EigenBaseSparseMatrix< TReal > Class Template Reference

#include <EigenBaseSparseMatrix.h>

Inheritance diagram for sofa::linearalgebra::EigenBaseSparseMatrix< TReal >:

Detailed Description

template<class TReal>
class sofa::linearalgebra::EigenBaseSparseMatrix< TReal >

Sparse matrix based on the Eigen library.

An Eigen::SparseMatrix<Real, RowMajor> matrix is used to store the data in Compressed Row Storage mode. This matrix can not be accessed randomly. Two access modes are implemented.

The first access mode consists in inserting entries in increasing row, increasing column order. Method beginRow(Index index) must be called before any entry can be appended to row i.

Warning
beginRow must be called even for empty rows Then insertBack(i,j,value) must be used in for increasing j. There is no need to explicitly end a row. Finally, method compress() must be called after the last entry has been inserted. This is the most efficient access mode.

The second access mode is randow access, but you access an auxiliary matrix. Method add is used to add a value at a given location. Method compress() is then used to transfer this data to the compressed matrix. There is no way to replace an entry, you can only add.

Rows, columns, or the full matrix can be set to zero using the clear* methods.

Public Attributes

CompressedMatrix compressedMatrix
 the compressed matrix More...
 

Protected Attributes

SimplicialCholesky cholesky
 used to factorize the matrix and solve systems using Cholesky method, for symmetric positive definite matrices only. More...
 

Public Member Functions

 EigenBaseSparseMatrix (Index nbRow=0, Index nbCol=0)
 
 EigenBaseSparseMatrix (const ThisMatrix &m)
 copy constructor More...
 
void operator= (const ThisMatrix &m)
 copy operator More...
 
void set (Index i, Index j, double v) override
 Write the value of the element at row i, column j (using 0-based indices) More...
 
void setIdentity ()
 
void add (Index row, Index col, double value) override
 Schedule the addition of the value at the given place. Scheduled additions must be finalized using function compress(). More...
 
void beginRow (Index index)
 
void insertBack (Index row, Index col, Real value)
 
RealcoeffRef (Index i, Index j)
 Return a reference to the given entry in the compressed matrix.There can (must ?) be a value at this place already. Efficient only if the it is at the last place of the compressed matrix. More...
 
void copy (const EigenBaseSparseMatrix &m, unsigned nbCol, unsigned shift)
 
void resize (Index nbRow, Index nbCol) override
 Resize the matrix without preserving the data (the matrix is set to zero) More...
 
Index rowSize (void) const override
 number of rows More...
 
Index colSize (void) const override
 number of columns More...
 
void reserve (typename CompressedMatrix::Index reserveSize)
 
SReal element (Index i, Index j) const override
 Read the value of the element at row i, column j (using 0-based indices) More...
 
void compress () override
 Add the values from the scheduled list, and clears the schedule list. More...
 
IndexgetRowBegin ()
 
IndexgetColsIndex ()
 
RealgetColsValue ()
 
void clearRow (Index i) override
 Set all the entries of a row to 0. More...
 
void clearRows (Index imin, Index imax) override
 Set all the entries of rows imin to imax-1 to 0. More...
 
void clearCol (Index col) override
 Clears the all the entries of column imin to column imax-1. Not efficient ! More...
 
void clearCols (Index imin, Index imax) override
 Set all the entries of column i and of row i to 0. Not efficient ! More...
 
void clearRowCol (Index i) override
 Clears all the entries of rows imin to imax-1 and columns imin to imax-1. More...
 
void clearRowsCols (Index imin, Index imax) override
 Clears all the values in rows imin to imax-1 and columns imin to imax-1. More...
 
void clear () override
 Set all values to 0, by resizing to the same size. More...
 
void mult (VectorEigen &result, const VectorEigen &data)
 Matrix-vector product. More...
 
void mult_MT (VectorEigen &result, const VectorEigen &data)
 Matrix-vector product openmp multithreaded. More...
 
template<class V1 , class V2 >
void multVector (V1 &output, const V2 &input)
 Matrix-Vector product (dense vector with contiguous memory layout) More...
 
template<class V >
operator* (const V &input)
 Matrix-Vector product (dense vector with contiguous memory layout) More...
 
bool choleskyDecompose ()
 Try to compute the LDLT decomposition, and return true if success. The matrix is unchanged. More...
 
void choleskySolve (VectorEigen &x, const VectorEigen &b) const
 Solve Ax=b, where A is this matrix. WARNING: ldltDecompose() must be called first. x and b can be the same vector. More...
 
void addToBaseMatrix (BaseMatrix *matrix, SReal factor, Index offset) const
 add this EigenBaseSparseMatrix to a BaseMatrix at the offset and multiplied by factor More...
 
void mul (EigenBaseSparseMatrix< Real > &res, const EigenBaseSparseMatrix< Real > &rhs) const
 
void mul_MT (EigenBaseSparseMatrix< Real > &res, const EigenBaseSparseMatrix< Real > &rhs) const
 
void mul (Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > &res, const Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > &rhs)
 Sparse x Dense Matrix product. More...
 
void mul_MT (Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > &res, const Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > &rhs)
 Sparse x Dense Matrix product openmp multithreaded. More...
 
const charName ()
 
const charName ()
 
- Public Member Functions inherited from sofa::linearalgebra::BaseMatrix
 BaseMatrix ()
 
virtual ~BaseMatrix ()
 
Index rows (void) const
 Number of rows (Eigen-compatible API) More...
 
Index cols (void) const
 Number of columns (Eigen-compatible API) More...
 
SReal operator() (Index i, Index j) const
 Read the value of the element at row i, column j (using 0-based indices). Eigen-compatible API. More...
 
virtual void add (Index row, Index col, const type::Mat3x3d &_M)
 Adding values from a 3x3d matrix. This function may be overload to obtain better performances. More...
 
virtual void add (Index row, Index col, const type::Mat3x3f &_M)
 Adding values from a 3x3f matrix. This function may be overload to obtain better performances. More...
 
virtual void add (Index row, Index col, const type::Mat2x2d &_M)
 Adding values from a 2x2d matrix. This function may be overload to obtain better performances. More...
 
virtual void add (Index row, Index col, const type::Mat2x2f &_M)
 Adding values from a 2x2f matrix. This function may be overload to obtain better performances. More...
 
virtual void add (Index row, Index col, const type::Mat6x6d &_M)
 Adding values from a 6x6d matrix. This function may be overload to obtain better performances. More...
 
virtual void add (Index row, Index col, const type::Mat6x6f &_M)
 Adding values from a 6x6f matrix. This function may be overload to obtain better performances. More...
 
virtual void clear (Index i, Index j)
 
virtual void opMulV (linearalgebra::BaseVector *result, const linearalgebra::BaseVector *v) const
 Multiply the matrix by vector v and put the result in vector result. More...
 
virtual void opMulV (float *result, const float *v) const
 Multiply the matrix by float vector v and put the result in vector result. More...
 
virtual void opMulV (double *result, const double *v) const
 Multiply the matrix by double vector v and put the result in vector result. More...
 
virtual void opPMulV (linearalgebra::BaseVector *result, const linearalgebra::BaseVector *v) const
 Multiply the matrix by vector v and add the result in vector result. More...
 
virtual void opPMulV (float *result, const float *v) const
 Multiply the matrix by float vector v and add the result in vector result. More...
 
virtual void opPMulV (double *result, const double *v) const
 Multiply the matrix by double vector v and add the result in vector result. More...
 
virtual void opMulTV (linearalgebra::BaseVector *result, const linearalgebra::BaseVector *v) const
 Multiply the transposed matrix by vector v and put the result in vector result. More...
 
virtual void opMulTV (float *result, const float *v) const
 Multiply the transposed matrix by float vector v and put the result in vector result. More...
 
virtual void opMulTV (double *result, const double *v) const
 Multiply the transposed matrix by double vector v and put the result in vector result. More...
 
virtual void opPMulTV (linearalgebra::BaseVector *result, const linearalgebra::BaseVector *v) const
 Multiply the transposed matrix by vector v and add the result in vector result. More...
 
virtual void opPMulTV (float *result, const float *v) const
 Multiply the transposed matrix by float vector v and add the result in vector result. More...
 
virtual void opPMulTV (double *result, const double *v) const
 Multiply the transposed matrix by double vector v and add the result in vector result. More...
 
virtual void opMulTM (BaseMatrix *result, BaseMatrix *m) const
 Multiply the transposed matrix by matrix m and store the result in matrix result. More...
 
virtual void opAddM (linearalgebra::BaseMatrix *m, double fact) const
 Subtract the matrix to the m matrix and strore the result in m. More...
 
virtual void opAddMT (linearalgebra::BaseMatrix *m, double fact) const
 Subtract the transposed matrix to the m matrix and strore the result in m. More...
 
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
 Get read access to a block. More...
 
virtual BlockAccessor blocGetW (Index i, Index j)
 Get write access to a block. More...
 
virtual BlockAccessor blocCreate (Index i, Index j)
 Get write access to a block, possibly creating it. More...
 
template<class T >
const T * blocElements (Index i, Index j, T *buffer) const
 Shortcut for blocGet(i,j).elements(buffer) More...
 
template<class T >
void blocSet (Index i, Index j, const T *buffer)
 Shortcut for blocCreate(i,j).set(buffer) More...
 
template<class T >
void blocAdd (Index i, Index j, const T *buffer)
 Shortcut for blocCreate(i,j).add(buffer) More...
 
virtual ColBlockConstIterator bRowBegin (Index ib) const
 Get the iterator corresponding to the beginning of the given row of blocks. More...
 
virtual ColBlockConstIterator bRowEnd (Index ib) const
 Get the iterator corresponding to the end of the given row of blocks. More...
 
virtual std::pair< ColBlockConstIterator, ColBlockConstIteratorbRowRange (Index ib) const
 Get the iterators corresponding to the beginning and end of the given row of blocks. More...
 
virtual RowBlockConstIterator bRowsBegin () const
 Get the iterator corresponding to the beginning of the rows of blocks. More...
 
virtual RowBlockConstIterator bRowsEnd () const
 Get the iterator corresponding to the end of the rows of blocks. More...
 
virtual std::pair< RowBlockConstIterator, RowBlockConstIteratorbRowsRange () const
 Get the iterators corresponding to the beginning and end of the given row of blocks. More...
 

Static Public Member Functions

static const charName ()
 

Additional Inherited Members

- 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)
 
template<class T >
const T * bAccessorElementsDefaultImpl (const InternalBlockAccessor *b, T *buffer) const
 
virtual const floatbAccessorElements (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
 
template<class T >
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)
 
template<class T >
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)
 
template<class T >
T * bAccessorPrepareAddDefaultImpl (InternalBlockAccessor *, T *buffer)
 
virtual floatbAccessorPrepareAdd (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

◆ cholesky

template<class TReal >
SimplicialCholesky sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::cholesky
protected

used to factorize the matrix and solve systems using Cholesky method, for symmetric positive definite matrices only.

◆ compressedMatrix

template<class TReal >
CompressedMatrix sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::compressedMatrix

the compressed matrix

Constructor details

◆ EigenBaseSparseMatrix() [1/2]

template<class TReal >
sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::EigenBaseSparseMatrix ( Index  nbRow = 0,
Index  nbCol = 0 
)
inline

◆ EigenBaseSparseMatrix() [2/2]

template<class TReal >
sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::EigenBaseSparseMatrix ( const ThisMatrix m)
inline

copy constructor

Function details

◆ add()

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::add ( Index  row,
Index  col,
double  value 
)
inlineoverridevirtual

Schedule the addition of the value at the given place. Scheduled additions must be finalized using function compress().

Implements sofa::linearalgebra::BaseMatrix.

◆ addToBaseMatrix()

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::addToBaseMatrix ( BaseMatrix matrix,
SReal  factor,
Index  offset 
) const
inline

add this EigenBaseSparseMatrix to a BaseMatrix at the offset and multiplied by factor

◆ beginRow()

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::beginRow ( Index  index)
inline

◆ choleskyDecompose()

template<class TReal >
bool sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::choleskyDecompose ( )
inline

Try to compute the LDLT decomposition, and return true if success. The matrix is unchanged.

◆ choleskySolve()

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::choleskySolve ( VectorEigen x,
const VectorEigen b 
) const
inline

Solve Ax=b, where A is this matrix. WARNING: ldltDecompose() must be called first. x and b can be the same vector.

◆ clear()

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::clear ( )
inlineoverridevirtual

Set all values to 0, by resizing to the same size.

Implements sofa::linearalgebra::BaseMatrix.

◆ clearCol()

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::clearCol ( Index  col)
inlineoverridevirtual

Clears the all the entries of column imin to column imax-1. Not efficient !

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ clearCols()

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::clearCols ( Index  imin,
Index  imax 
)
inlineoverridevirtual

Set all the entries of column i and of row i to 0. Not efficient !

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ clearRow()

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::clearRow ( Index  i)
inlineoverridevirtual

Set all the entries of a row to 0.

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ clearRowCol()

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::clearRowCol ( Index  i)
inlineoverridevirtual

Clears all the entries of rows imin to imax-1 and columns imin to imax-1.

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ clearRows()

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::clearRows ( Index  imin,
Index  imax 
)
inlineoverridevirtual

Set all the entries of rows imin to imax-1 to 0.

Set all the entries of a column to 0. Not efficient !

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ clearRowsCols()

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::clearRowsCols ( Index  imin,
Index  imax 
)
inlineoverridevirtual

Clears all the values in rows imin to imax-1 and columns imin to imax-1.

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ coeffRef()

template<class TReal >
Real& sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::coeffRef ( Index  i,
Index  j 
)
inline

Return a reference to the given entry in the compressed matrix.There can (must ?) be a value at this place already. Efficient only if the it is at the last place of the compressed matrix.

◆ colSize()

template<class TReal >
Index sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::colSize ( void  ) const
inlineoverridevirtual

number of columns

Implements sofa::linearalgebra::BaseMatrix.

◆ compress()

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::compress ( )
inlineoverridevirtual

Add the values from the scheduled list, and clears the schedule list.

See also
set(Index i, Index j, double v).

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ copy()

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::copy ( const EigenBaseSparseMatrix< TReal > &  m,
unsigned  nbCol,
unsigned  shift 
)
inline

Clear and resize this to (m.rows,nbCol) and initialize it with the given matrix, columns shifted of the given value: this(i,j+shift) = m(i,j). @precond nbCol >= m.cols + shift

◆ element()

template<class TReal >
SReal sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::element ( Index  i,
Index  j 
) const
inlineoverridevirtual

Read the value of the element at row i, column j (using 0-based indices)

Implements sofa::linearalgebra::BaseMatrix.

◆ getColsIndex()

template<class TReal >
Index* sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::getColsIndex ( )
inline

◆ getColsValue()

template<class TReal >
Real* sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::getColsValue ( )
inline

◆ getRowBegin()

template<class TReal >
Index* sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::getRowBegin ( )
inline

◆ insertBack()

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::insertBack ( Index  row,
Index  col,
Real  value 
)
inline

Insert in the compressed matrix. There must be no value at this place already. Efficient only if the value is inserted at the last place of the last row.

Warning
the line must be created previously with "beginRow"

◆ mul() [1/2]

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::mul ( Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > &  res,
const Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > &  rhs 
)
inline

Sparse x Dense Matrix product.

◆ mul() [2/2]

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::mul ( EigenBaseSparseMatrix< Real > &  res,
const EigenBaseSparseMatrix< Real > &  rhs 
) const
inline

EigenBaseSparseMatrix multiplication res can be the same variable as this or rhs

◆ mul_MT() [1/2]

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::mul_MT ( Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > &  res,
const Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > &  rhs 
)
inline

Sparse x Dense Matrix product openmp multithreaded.

◆ mul_MT() [2/2]

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::mul_MT ( EigenBaseSparseMatrix< Real > &  res,
const EigenBaseSparseMatrix< Real > &  rhs 
) const
inline

EigenBaseSparseMatrix multiplication (openmp multithreaded version)

Warning
res MUST NOT be the same variable as this or rhs

◆ mult()

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::mult ( VectorEigen result,
const VectorEigen data 
)
inline

Matrix-vector product.

◆ mult_MT()

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::mult_MT ( VectorEigen result,
const VectorEigen data 
)
inline

Matrix-vector product openmp multithreaded.

◆ multVector()

template<class TReal >
template<class V1 , class V2 >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::multVector ( V1 &  output,
const V2 &  input 
)
inline

Matrix-Vector product (dense vector with contiguous memory layout)

◆ Name() [1/3]

template<class TReal >
static const char* sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::Name ( )
static

◆ Name() [2/3]

const char * sofa::linearalgebra::EigenBaseSparseMatrix< double >::Name ( )
inline

◆ Name() [3/3]

◆ operator*()

template<class TReal >
template<class V >
V sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::operator* ( const V &  input)
inline

Matrix-Vector product (dense vector with contiguous memory layout)

◆ operator=()

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::operator= ( const ThisMatrix m)
inline

copy operator

◆ reserve()

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::reserve ( typename CompressedMatrix::Index  reserveSize)
inline

◆ resize()

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::resize ( Index  nbRow,
Index  nbCol 
)
inlineoverridevirtual

Resize the matrix without preserving the data (the matrix is set to zero)

Implements sofa::linearalgebra::BaseMatrix.

◆ rowSize()

template<class TReal >
Index sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::rowSize ( void  ) const
inlineoverridevirtual

number of rows

Implements sofa::linearalgebra::BaseMatrix.

◆ set()

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::set ( Index  i,
Index  j,
double  v 
)
inlineoverridevirtual

Write the value of the element at row i, column j (using 0-based indices)

Implements sofa::linearalgebra::BaseMatrix.

◆ setIdentity()

template<class TReal >
void sofa::linearalgebra::EigenBaseSparseMatrix< TReal >::setIdentity ( )
inline