SOFA API  82c4ea2a
Open source framework for multi-physics simuation
sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy > Class Template Referencefinal

#include <CompressedRowSparseMatrixMechanical.h>

Inheritance diagram for sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >:

Public Attributes

Index nRow
 Size. More...
 
Index nCol
 Mathematical size of the matrix, in scalars. More...
 
- Public Attributes inherited from sofa::linearalgebra::CompressedRowSparseMatrixGeneric< TBlock, CRSMechanicalPolicy >
Index nBlockRow
 Size. More...
 
Index nBlockCol
 Mathematical size of the matrix, in blocks. More...
 
VecIndex rowIndex
 Compressed sparse data structure. More...
 
VecIndex rowBegin
 column indices of non-empty blocks in each row. The column indices of the non-empty block within the i-th non-empty row are all the colsIndex[j], j in [rowBegin[i],rowBegin[i+1]) More...
 
VecIndex colsIndex
 column indices of all the non-empty blocks, sorted by increasing row index and column index More...
 
VecBlock colsValue
 values of the non-empty blocks, in the same order as in colsIndex More...
 
VecFlag touchedBlock
 boolean vector, i-th value is true if block has been touched since last compression. More...
 
VecIndexedBlock btemp
 Additional storage to make block insertion more efficient. More...
 
bool skipCompressZero
 
VecIndex oldRowIndex
 Temporary vectors used during compression. More...
 
VecIndex oldRowBegin
 
VecIndex oldColsIndex
 
VecBlock oldColsValue
 

Static Public Attributes

static constexpr sofa::Index NL = traits::NL
 Number of rows of a block. More...
 
static constexpr sofa::Index NC = traits::NC
 Number of columns of a block. More...
 
- Static Public Attributes inherited from sofa::linearalgebra::CompressedRowSparseMatrixGeneric< TBlock, CRSMechanicalPolicy >
static constexpr sofa::Index NL
 Number of rows of a block. More...
 
static constexpr sofa::Index NC
 Number of columns of a block. More...
 
static constexpr Index s_invalidIndex
 
- Static Public Attributes inherited from sofa::linearalgebra::CRSMechanicalPolicy
static constexpr bool CompressZeros = false
 
static constexpr bool IsAlwaysSquare = true
 
static constexpr bool IsAlwaysSymmetric = true
 
static constexpr bool OrderedInsertion = false
 
static constexpr bool StoreLowerTriangularBlock = true
 
static constexpr int matrixType = 1
 
- Static Public Attributes inherited from sofa::linearalgebra::CRSDefaultPolicy
static constexpr bool IsAlwaysSquare = false
 Set to true if this matrix is always square (must be true for symmetric) More...
 
static constexpr bool IsAlwaysSymmetric = false
 Set to true if this matrix is always symmetric (IsAlwaysSquare should be true) More...
 
static constexpr bool AutoSize = false
 Set to true if the size of the matrix should be automatically increased when new blocks are added. More...
 
static constexpr bool AutoCompress = true
 Set to true if the matrix should be automatically compressed (easier to use, but might cause issues in multithreading) More...
 
static constexpr bool CompressZeros = true
 Set to true if the blocks that are all zeros should be removed from the matrix when compressing (expensive) More...
 
static constexpr bool ClearByZeros = true
 Set to true if clear methods will put all concerned value to zero instead of clearing vectors (CompressZeros should be true) More...
 
static constexpr bool OrderedInsertion = false
 Set to true if insertion in matrix are in most case at last line index or last col index. More...
 
static constexpr bool StoreLowerTriangularBlock = true
 Set to false to disable storage of blocks on the lower triangular part (IsAlwaysSymmetric must be true) More...
 
static constexpr int matrixType = 0
 Do not change this value, has to be overrided for all derivated class. More...
 

Public Member Functions

 CompressedRowSparseMatrixMechanical ()
 
 CompressedRowSparseMatrixMechanical (Index nbRow, Index nbCol)
 
void compress () override
 
void swap (Matrix &m)
 
template<typename = typename std::enable_if< Policy::IsAlwaysSquare>>
void fullDiagonal ()
 Make sure all diagonal entries are present even if they are zero. More...
 
Index rowSize () const override
 Mathematical size of the matrix. More...
 
Index colSize () const override
 Number of columns. More...
 
void resizeBlock (Index nbBRow, Index nbBCol) override
 This override classic resizeBlock to fill nRow and nCol values. More...
 
void resize (Index nbRow, Index nbCol) override
 
void extend (Index nbRow, Index nbCol)
 
SReal element (Index i, Index j) const override
 get scalar element i, j of matrix More...
 
void set (Index i, Index j, double v) override
 set scalar element i, j of matrix More...
 
void add (Index i, Index j, double v) override
 add scalar v at element i, j of matrix More...
 
void set (Index i, Index j, int &rowId, int &colId, double v)
 set scalar element i, j of matrix when rowId and colId are known More...
 
template<typename T = Block, typename std::enable_if_t<!std::is_same_v< T, double > &&!std::is_same_v< T, float >, int > = 0>
void add (Index i, Index j, int &rowId, int &colId, double v)
 add scalar v at element i, j when rowId and colId are known More...
 
void clear (Index i, Index j) override
 clear scalar at element i, j of matrix More...
 
void add (Index i, Index j, const type::Mat3x3d &_M) override
 
void add (Index i, Index j, const type::Mat3x3f &_M) override
 
void clearRow (Index i) override
 Clear row scalar method. Clear all col of this line. More...
 
void clearCol (Index j) override
 Clear col scalar method. Clear this col in all row of matrix. More...
 
void clearRowCol (Index i) override
 Clear both row i and column i in a square matrix. More...
 
void clear () override
 Completely clear the matrix. More...
 
template<class M2 >
bool hasRef (const M2 *m) const
 
std::string expr () const
 
bool valid () const
 
template<class Dest >
void addTo (Dest *dest) const
 
template<class TBlock2 , class TPolicy2 >
void operator= (const CompressedRowSparseMatrixMechanical< TBlock2, TPolicy2 > &m)
 
template<class TBlock2 , class TPolicy2 >
void operator+= (const CompressedRowSparseMatrixMechanical< TBlock2, TPolicy2 > &m)
 
template<class TBlock2 , class TPolicy2 >
void operator-= (const CompressedRowSparseMatrixMechanical< TBlock2, TPolicy2 > &m)
 
template<class Expr2 >
void operator= (const MatrixExpr< Expr2 > &m)
 
template<class Expr2 >
void operator+= (const MatrixExpr< Expr2 > &m)
 
template<class Expr2 >
void operator-= (const MatrixExpr< Expr2 > &m)
 
MatrixExpr< MatrixTranspose< Matrix > > t () const
 
MatrixExpr< MatrixNegative< Matrix > > operator- () const
 
MatrixExpr< MatrixScale< Matrix, double > > operator* (const double &r) const
 
void add (Index row, Index col, const type::Mat3x3d &_M)
 
void add (Index row, Index col, const type::Mat3x3f &_M)
 
void add (Index row, Index col, const type::Mat3x3d &_M)
 
void add (Index row, Index col, const type::Mat3x3f &_M)
 
void SOFA_LINEARALGEBRA_API add (Index row, Index col, const type::Mat3x3d &_M)
 
void SOFA_LINEARALGEBRA_API add (Index row, Index col, const type::Mat3x3f &_M)
 
void SOFA_LINEARALGEBRA_API add (Index row, Index col, const type::Mat3x3d &_M)
 
void SOFA_LINEARALGEBRA_API add (Index row, Index col, const type::Mat3x3f &_M)
 
BlockMatrixWriter operators
template<typename T = Block, typename std::enable_if_t<!std::is_same_v< T, double > &&!std::is_same_v< T, float >, int > = 0>
void add (unsigned int bi, unsigned int bj, const Block &b)
 Override CRSMatrix add method to avoid mis-understanding by compiler with other add method overriding BaseMatrix. More...
 
Get information about the content and structure of this matrix (diagonal, band, sparse, full, block size, ...)
virtual ElementType getElementType () const override
 
virtual std::size_t getElementSize () const override
 
virtual MatrixCategory getCategory () const override
 
virtual Index getBlockRows () const override
 
virtual Index getBlockCols () const override
 
virtual Index bRowSize () const override
 
virtual Index bColSize () const override
 
virtual Index getBandWidth () const override
 
Matrix operators
CompressedRowSparseMatrixMechanical< TBlock, TPolicy > operator+ (const CompressedRowSparseMatrixMechanical< TBlock, TPolicy > &m) const
 
template<typename V1 , typename V2 , std::enable_if_t< sofa::type::trait::is_vector< V1 >::value &&sofa::type::trait::is_vector< V2 >::value, int > = 0>
void mul (V2 &result, const V1 &v) const
 
template<typename V1 , typename V2 >
void addMultTranspose (V1 &result, const V2 &v) const
 
template<class Vec >
Vec operator* (const Vec &v) const
 
template<typename V , typename Real2 >
void addMul_by_line (V &res, const type::Vec< NC, Real2 > &v) const
 
template<typename Real , typename V , typename V2 >
void addMul_by_line (V &res, const V2 &v) const
 
template<typename V1 , typename V2 >
void addMul (V1 &res, const V2 &v) const
 result += this * v More...
 
- Public Member Functions inherited from sofa::linearalgebra::CompressedRowSparseMatrixGeneric< TBlock, CRSMechanicalPolicy >
 CompressedRowSparseMatrixGeneric ()
 
 CompressedRowSparseMatrixGeneric (Index nbBlockRow, Index nbBlockCol)
 
virtual ~CompressedRowSparseMatrixGeneric ()=default
 
Index rowBSize () const
 
Index colBSize () const
 
const VecIndexgetRowIndex () const
 
const VecIndexgetRowBegin () const
 
Range getRowRange (Index id) const
 Returns the range of indices from the column indices corresponding to the id-th row. More...
 
const VecIndexgetColsIndex () const
 
const VecBlockgetColsValue () const
 
void resizeBloc (Index nbBRow, Index nbBCol)
 
void compress ()
 
void swap (Matrix &m)
 
void fullRows ()
 Make sure all rows have an entry even if they are empty. More...
 
void shiftIndices (Index base)
 
const Blockblock (Index i, Index j) const
 Get block method. More...
 
const Blockbloc (Index i, Index j) const
 
Blockwblock (Index i, Index j, bool create=false)
 Write block method. More...
 
Blockwblock (Index i, Index j, Index &rowId, Index &colId, bool create=false)
 Write block method when rowId and colId are known, this is an optimized wblock specification. More...
 
Blockwbloc (Index i, Index j, bool create=false)
 
const BlockgetBlock (Index i, Index j) const
 
const BlockTranspose getSymBlock (Index i, Index j) const
 
void setBlock (Index i, Index j, const Block &v)
 
void setBlock (Index i, Index j, Index &rowId, Index &colId, const Block &v)
 
void addBlock (Index i, Index j, const Block &v)
 
void addBlock (Index i, Index j, Index &rowId, Index &colId, const Block &v)
 
BlockgetWBlock (Index i, Index j, bool create=false)
 
void clearRowBlock (Index i)
 Clear row block method. Clear all col of this line. More...
 
void clearColBlock (Index j)
 Clear col block method. Clear this col in all row of matrix. More...
 
std::size_t countEmptyBlocks () const
 
void clearRowColBlock (Index i)
 Clear both row i and column i in a square matrix. More...
 
void clear ()
 Completely clear the matrix. More...
 
bool check_matrix ()
 
std::ostream & write (std::ostream &os) const
 
std::istream & read (std::istream &is)
 
void add (unsigned int bi, unsigned int bj, const Block &b)
 
void add (unsigned int bi, unsigned int bj, int &rowId, int &colId, const Block &b)
 
void addDBlock (unsigned int bi, unsigned int bj, const DBlock &b)
 
void addDValue (unsigned int bi, unsigned int bj, const Real b)
 
void addDValue (unsigned int bi, unsigned int bj, int &rowId, int &colId, const Real b)
 
void addDiag (unsigned int bi, const Block &b)
 
void addDiag (unsigned int bi, int &rowId, int &colId, const Block &b)
 
void addDiagDBlock (unsigned int bi, const DBlock &b)
 
void addDiagDValue (unsigned int bi, const Real b)
 
void addDiagDValue (unsigned int bi, int &rowId, int &colId, const Real b)
 
void addSym (unsigned int bi, unsigned int bj, const Block &b)
 
void addSym (unsigned int bi, unsigned int bj, int &rowId, int &colId, int &rowIdT, int &colIdT, const Block &b)
 
void addSymDBlock (unsigned int bi, unsigned int bj, const DBlock &b)
 
void addSymDValue (unsigned int bi, unsigned int bj, const Real b)
 
void addSymDValue (unsigned int bi, unsigned int bj, int &rowId, int &colId, int &rowIdT, int &colIdT, Real b)
 
void transposeFullRows (CompressedRowSparseMatrixGeneric< TBlock2, TPolicy2 > &res) const
 Transpose the matrix into res, works only for 3 array variant ("full rows") matrices, ie which can be expressed using the rowBegin, colsIndex and colsValue arrays solely. More...
 
void mul (CompressedRowSparseMatrixGeneric< RB, RP > &res, const CompressedRowSparseMatrixGeneric< MB, MP > &m) const
 
void mulTranspose (CompressedRowSparseMatrixGeneric< RB, RP > &res, const CompressedRowSparseMatrixGeneric< MB, MP > &m) const
 
- 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...
 
virtual SReal element (Index i, Index j) const =0
 Read the value of the element at row i, column j (using 0-based indices) 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 resize (Index nbRow, Index nbCol)=0
 Resize the matrix and reset all values to 0. More...
 
virtual void set (Index i, Index j, double v)=0
 Write the value of the element at row i, column j (using 0-based indices) More...
 
virtual void add (Index row, Index col, double v)=0
 Add v to the existing value of the element at row i, column j (using 0-based indices) 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 clearRow (Index i)
 Reset all the values in row i to 0. More...
 
virtual void clearRows (Index imin, Index imax)
 Clears the value of rows imin to imax-1. More...
 
virtual void clearCol (Index j)
 Reset the all values in column j to 0. More...
 
virtual void clearCols (Index imin, Index imax)
 Clears all the values in columns imin to imax-1. More...
 
virtual void clearRowCol (Index i)
 Reset the value of both row and column i to 0. More...
 
virtual void clearRowsCols (Index imin, Index imax)
 Clears all the values in rows imin to imax-1 and columns imin to imax-1. More...
 
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...
 
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...
 

Static Public Member Functions

static void split_row_index (Index &index, Index &modulo)
 
static void split_col_index (Index &index, Index &modulo)
 
static const charName ()
 
- Static Public Member Functions inherited from sofa::linearalgebra::CompressedRowSparseMatrixGeneric< TBlock, CRSMechanicalPolicy >
static bool sortedFind (const VecIndex &v, Range in, Index val, Index &result)
 
static bool sortedFind (const VecIndex &v, Index val, Index &result)
 
static const charName ()
 
static bool check_matrix (Index nzmax, Index m, Index n, Index *a_p, Index *a_i, Block *a_x)
 
static auto blockMultTranspose (const TBlock &blockA, const TBlock &blockB)
 

Protected Member Functions

template<class M >
void equal (const M &m, bool add=false)
 
template<class M >
void addEqual (const M &m)
 this += m More...
 
- Protected Member Functions inherited from sofa::linearalgebra::CompressedRowSparseMatrixGeneric< TBlock, CRSMechanicalPolicy >
bool registerNewCol (Index &colId, TBlock &bvalue)
 Add a new col into matrix. More...
 
std::pair< Index, IndexregisterBtempLine (typename VecIndexedBlock::const_iterator &itbtemp)
 Add a complete new line from btemp into matrix. More...
 
void fullyCompressBtemp ()
 Clear matrix and just add btemp array. More...
 
BlockinsertBtemp (const Index i, const Index j)
 Method to easy insert new block into btemp. More...
 
Index getMaxColIndex ()
 Method to easy have the max colIndex. Could only be used if AutoSize policy is activated. More...
 
void deleteRow (Index rowId)
 Method to easy delete row given position in rowIndex. More...
 
void compressBtemp ()
 Clear matrix and compute new triplet's arrays by combining old ones and btemp(VecIndexedBlock) array. More...
 
void compressCSR ()
 
void writeVector (const TVec &vec, std::ostream &os)
 
void readVector (TVec &vec, std::istream &in)
 
- Protected Member Functions inherited from sofa::linearalgebra::BaseMatrix
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
 
template<class T >
void bAccessorSetDefaultImpl (InternalBlockAccessor *b, const T *buffer)
 
template<class T >
void bAccessorAddDefaultImpl (InternalBlockAccessor *b, const T *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
 
ColBlockConstIterator createColBlockConstIterator (Index row, void *internalPtr) const
 
ColBlockConstIterator createColBlockConstIterator (Index row, Index internalData) const
 
RowBlockConstIterator createRowBlockConstIterator (void *internalPtr) const
 
RowBlockConstIterator createRowBlockConstIterator (Index internalData0, Index internalData1) const
 

Filtering-out part of a matrix

typedef bool filter_fn(Index i, Index j, Block &val, const Real ref)
 
template<class TMatrix >
void filterValues (TMatrix &srcMatrix, filter_fn *filter=&nonzeros, const Real ref=Real(), bool keepEmptyRows=false)
 
template<class TMatrix >
void copyNonZeros (TMatrix &M, bool keepEmptyRows=false)
 
template<class TMatrix >
void copyNonSmall (TMatrix &M, const Real ref, bool keepEmptyRows=false)
 
void copyUpper (Matrix &M, bool keepEmptyRows=false)
 
void copyLower (Matrix &M, bool keepEmptyRows=false)
 
template<class TMatrix >
void copyUpperNonZeros (TMatrix &M, bool keepEmptyRows=false)
 
template<class TMatrix >
void copyLowerNonZeros (TMatrix &M, bool keepEmptyRows=false)
 
void copyUpperNonSmall (Matrix &M, const Real ref, bool keepEmptyRows=false)
 
void copyLowerNonSmall (Matrix &M, const Real ref, bool keepEmptyRows=false)
 
static bool nonzeros (Index, Index, Block &val, const Real)
 
static bool nonsmall (Index, Index, Block &val, const Real ref)
 
static bool upper (Index i, Index j, Block &val, const Real)
 
static bool lower (Index i, Index j, Block &val, const Real)
 
static bool upper_nonzeros (Index i, Index j, Block &val, const Real ref)
 
static bool lower_nonzeros (Index i, Index j, Block &val, const Real ref)
 
static bool upper_nonsmall (Index i, Index j, Block &val, const Real ref)
 
static bool lower_nonsmall (Index i, Index j, Block &val, const Real ref)
 

Virtual iterator classes and methods

virtual BlockConstAccessor blockGet (Index i, Index j) const
 Get read access to a block. More...
 
virtual BlockAccessor blockGetW (Index i, Index j)
 Get write access to a block. More...
 
virtual BlockAccessor blockCreate (Index i, Index j)
 Get write access to a block, possibly creating it. More...
 
virtual ColBlockConstIterator bRowBegin (Index ib) const override
 Get the iterator corresponding to the beginning of the given row of blocks. More...
 
virtual ColBlockConstIterator bRowEnd (Index ib) const override
 Get the iterator corresponding to the end of the given row of blocks. More...
 
virtual std::pair< ColBlockConstIterator, ColBlockConstIteratorbRowRange (Index ib) const override
 Get the iterators corresponding to the beginning and end of the given row of blocks. More...
 
virtual RowBlockConstIterator bRowsBegin () const override
 Get the iterator corresponding to the beginning of the rows of blocks. More...
 
virtual RowBlockConstIterator bRowsEnd () const override
 Get the iterator corresponding to the end of the rows of blocks. More...
 
virtual std::pair< RowBlockConstIterator, RowBlockConstIteratorbRowsRange () const override
 Get the iterators corresponding to the beginning and end of the given row of blocks. More...
 
virtual void bAccessorDelete (const InternalBlockAccessor *) const override
 
virtual void bAccessorCopy (InternalBlockAccessor *) const override
 
virtual SReal bAccessorElement (const InternalBlockAccessor *b, Index i, Index j) const override
 
virtual void bAccessorSet (InternalBlockAccessor *b, Index i, Index j, double v) override
 
virtual void bAccessorAdd (InternalBlockAccessor *b, Index i, Index j, double v) override
 
template<class T >
const T * bAccessorElementsCSRImpl (const InternalBlockAccessor *b, T *buffer) const
 
virtual const floatbAccessorElements (const InternalBlockAccessor *b, float *buffer) const override
 
virtual const double * bAccessorElements (const InternalBlockAccessor *b, double *buffer) const override
 
virtual const int * bAccessorElements (const InternalBlockAccessor *b, int *buffer) const override
 
template<class T >
void bAccessorSetCSRImpl (InternalBlockAccessor *b, const T *buffer)
 
virtual void bAccessorSet (InternalBlockAccessor *b, const float *buffer) override
 
virtual void bAccessorSet (InternalBlockAccessor *b, const double *buffer) override
 
virtual void bAccessorSet (InternalBlockAccessor *b, const int *buffer) override
 
template<class T >
void bAccessorAddCSRImpl (InternalBlockAccessor *b, const T *buffer)
 
virtual void bAccessorAdd (InternalBlockAccessor *b, const float *buffer) override
 
virtual void bAccessorAdd (InternalBlockAccessor *b, const double *buffer) override
 
virtual void bAccessorAdd (InternalBlockAccessor *b, const int *buffer) override
 
virtual void itCopyColBlock (InternalColBlockIterator *) const override
 
virtual void itDeleteColBlock (const InternalColBlockIterator *) const override
 
virtual void itAccessColBlock (InternalColBlockIterator *it, BlockConstAccessor *b) const override
 
virtual void itIncColBlock (InternalColBlockIterator *it) const override
 
virtual void itDecColBlock (InternalColBlockIterator *it) const override
 
virtual bool itEqColBlock (const InternalColBlockIterator *it, const InternalColBlockIterator *it2) const override
 
virtual bool itLessColBlock (const InternalColBlockIterator *it, const InternalColBlockIterator *it2) const override
 
virtual void itCopyRowBlock (InternalRowBlockIterator *) const override
 
virtual void itDeleteRowBlock (const InternalRowBlockIterator *) const override
 
virtual Index itAccessRowBlock (InternalRowBlockIterator *it) const override
 
virtual ColBlockConstIterator itBeginRowBlock (InternalRowBlockIterator *it) const override
 
virtual ColBlockConstIterator itEndRowBlock (InternalRowBlockIterator *it) const override
 
virtual std::pair< ColBlockConstIterator, ColBlockConstIteratoritRangeRowBlock (InternalRowBlockIterator *it) const override
 
virtual void itIncRowBlock (InternalRowBlockIterator *it) const override
 
virtual void itDecRowBlock (InternalRowBlockIterator *it) const override
 
virtual bool itEqRowBlock (const InternalRowBlockIterator *it, const InternalRowBlockIterator *it2) const override
 
virtual bool itLessRowBlock (const InternalRowBlockIterator *it, const InternalRowBlockIterator *it2) const override
 

setter/getter & product methods on template vector types

template<class Real2 , class V1 , class V2 >
void tmul (V1 &res, const V2 &vec) const
 
template<class Real2 , class V1 , class V2 >
void taddMul (V1 &res, const V2 &vec) const
 
template<class Real2 , class V1 , class V2 >
void taddMul_by_line (V1 &res, const V2 &vec) const
 
template<class Real2 , class V1 , class V2 >
void taddMulTranspose (V1 &res, const V2 &vec) const
 
template<class Vec >
static Real vget (const Vec &vec, Index i, Index j, Index k)
 
template<class Vec >
static Real vget (const type::vector< Vec > &vec, Index i, Index, Index k)
 
static Real vget (const BaseVector &vec, Index i)
 
template<class Real2 >
static Real2 vget (const 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 (type::vector< Vec > &vec, Index i, Index, Index k, Real v)
 
static void vset (BaseVector &vec, Index i, Real v)
 
template<class Real2 >
static void vset (FullVector< Real2 > &vec, Index i, Real2 v)
 
template<class Vec >
static void vadd (Vec &vec, Index i, Index j, Index k, Real v)
 
template<class Vec >
static void vadd (type::vector< Vec > &vec, Index i, Index, Index k, Real v)
 
static void vadd (BaseVector &vec, Index i, Real v)
 
template<class Real2 >
static void vadd (FullVector< Real2 > &vec, Index i, Real2 v)
 
template<class Vec >
static void vresize (Vec &vec, Index, Index totalSize)
 
template<class Vec >
static void vresize (type::vector< Vec > &vec, Index blockSize, Index)
 

Additional Inherited Members

- 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 sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::NC = traits::NC
staticconstexpr

Number of columns of a block.

◆ nCol

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
Index sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::nCol

Mathematical size of the matrix, in scalars.

◆ NL

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
constexpr sofa::Index sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::NL = traits::NL
staticconstexpr

Number of rows of a block.

◆ nRow

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
Index sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::nRow

Size.

Constructor details

◆ CompressedRowSparseMatrixMechanical() [1/2]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::CompressedRowSparseMatrixMechanical ( )
inline

◆ CompressedRowSparseMatrixMechanical() [2/2]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::CompressedRowSparseMatrixMechanical ( Index  nbRow,
Index  nbCol 
)
inline

Function details

◆ add() [1/13]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::add ( Index  i,
Index  j,
const type::Mat3x3d _M 
)
inlineoverride

◆ add() [2/13]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::add ( Index  i,
Index  j,
const type::Mat3x3f _M 
)
inlineoverride

◆ add() [3/13]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::add ( Index  i,
Index  j,
double  v 
)
inlineoverride

add scalar v at element i, j of matrix

◆ add() [4/13]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<typename T = Block, typename std::enable_if_t<!std::is_same_v< T, double > &&!std::is_same_v< T, float >, int > = 0>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::add ( Index  i,
Index  j,
int &  rowId,
int &  colId,
double  v 
)
inline

add scalar v at element i, j when rowId and colId are known

◆ add() [5/13]

void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< type::Mat< 3, 3, double > >::add ( Index  row,
Index  col,
const type::Mat3x3d _M 
)

◆ add() [6/13]

void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< type::Mat< 3, 3, float > >::add ( Index  row,
Index  col,
const type::Mat3x3d _M 
)

◆ add() [7/13]

void SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< type::Mat3x3d >::add ( Index  row,
Index  col,
const type::Mat3x3d _M 
)

◆ add() [8/13]

void SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< type::Mat3x3f >::add ( Index  row,
Index  col,
const type::Mat3x3d _M 
)

◆ add() [9/13]

void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< type::Mat< 3, 3, double > >::add ( Index  row,
Index  col,
const type::Mat3x3f _M 
)

◆ add() [10/13]

void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< type::Mat< 3, 3, float > >::add ( Index  row,
Index  col,
const type::Mat3x3f _M 
)

◆ add() [11/13]

void SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< type::Mat3x3d >::add ( Index  row,
Index  col,
const type::Mat3x3f _M 
)

◆ add() [12/13]

void SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< type::Mat3x3f >::add ( Index  row,
Index  col,
const type::Mat3x3f _M 
)

◆ add() [13/13]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<typename T = Block, typename std::enable_if_t<!std::is_same_v< T, double > &&!std::is_same_v< T, float >, int > = 0>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::add ( unsigned int  bi,
unsigned int  bj,
const Block b 
)
inline

Override CRSMatrix add method to avoid mis-understanding by compiler with other add method overriding BaseMatrix.

◆ addEqual()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class M >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::addEqual ( const M &  m)
inlineprotected

this += m

◆ addMul()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<typename V1 , typename V2 >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::addMul ( V1 &  res,
const V2 &  v 
) const
inline

result += this * v

◆ addMul_by_line() [1/2]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<typename V , typename Real2 >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::addMul_by_line ( V &  res,
const type::Vec< NC, Real2 > &  v 
) const
inline

result += this * (v,...,v)^T v has the size of one block

◆ addMul_by_line() [2/2]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<typename Real , typename V , typename V2 >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::addMul_by_line ( V &  res,
const V2 &  v 
) const
inline

◆ addMultTranspose()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<typename V1 , typename V2 >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::addMultTranspose ( V1 &  result,
const V2 &  v 
) const
inline

equal result += this^T * v

Warning
The block sizes must be compatible ie v.size() must be a multiple of block size.

◆ addTo()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Dest >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::addTo ( Dest *  dest) const
inline

dest += this different block types possible

◆ bAccessorAdd() [1/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bAccessorAdd ( InternalBlockAccessor b,
const double *  buffer 
)
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ bAccessorAdd() [2/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bAccessorAdd ( InternalBlockAccessor b,
const float buffer 
)
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ bAccessorAdd() [3/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bAccessorAdd ( InternalBlockAccessor b,
const int *  buffer 
)
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ bAccessorAdd() [4/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bAccessorAdd ( InternalBlockAccessor b,
Index  i,
Index  j,
double  v 
)
inlineoverrideprotectedvirtual

◆ bAccessorAddCSRImpl()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class T >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bAccessorAddCSRImpl ( InternalBlockAccessor b,
const T *  buffer 
)
inlineprotected

◆ bAccessorCopy()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bAccessorCopy ( InternalBlockAccessor ) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ bAccessorDelete()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bAccessorDelete ( const InternalBlockAccessor ) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ bAccessorElement()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual SReal sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bAccessorElement ( const InternalBlockAccessor b,
Index  i,
Index  j 
) const
inlineoverrideprotectedvirtual

◆ bAccessorElements() [1/3]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual const double* sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bAccessorElements ( const InternalBlockAccessor b,
double *  buffer 
) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ bAccessorElements() [2/3]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual const float* sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bAccessorElements ( const InternalBlockAccessor b,
float buffer 
) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ bAccessorElements() [3/3]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual const int* sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bAccessorElements ( const InternalBlockAccessor b,
int *  buffer 
) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ bAccessorElementsCSRImpl()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class T >
const T* sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bAccessorElementsCSRImpl ( const InternalBlockAccessor b,
T *  buffer 
) const
inlineprotected

◆ bAccessorSet() [1/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bAccessorSet ( InternalBlockAccessor b,
const double *  buffer 
)
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ bAccessorSet() [2/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bAccessorSet ( InternalBlockAccessor b,
const float buffer 
)
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ bAccessorSet() [3/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bAccessorSet ( InternalBlockAccessor b,
const int *  buffer 
)
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ bAccessorSet() [4/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bAccessorSet ( InternalBlockAccessor b,
Index  i,
Index  j,
double  v 
)
inlineoverrideprotectedvirtual

◆ bAccessorSetCSRImpl()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class T >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bAccessorSetCSRImpl ( InternalBlockAccessor b,
const T *  buffer 
)
inlineprotected

◆ bColSize()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual Index sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bColSize ( ) const
inlineoverridevirtual
Returns
the number of columns of blocks

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ blockCreate()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual BlockAccessor sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::blockCreate ( Index  i,
Index  j 
)
inlinevirtual

Get write access to a block, possibly creating it.

◆ blockGet()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual BlockConstAccessor sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::blockGet ( Index  i,
Index  j 
) const
inlinevirtual

Get read access to a block.

◆ blockGetW()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual BlockAccessor sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::blockGetW ( Index  i,
Index  j 
)
inlinevirtual

Get write access to a block.

◆ bRowBegin()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual ColBlockConstIterator sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bRowBegin ( Index  ib) const
inlineoverridevirtual

Get the iterator corresponding to the beginning of the given row of blocks.

◆ bRowEnd()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual ColBlockConstIterator sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bRowEnd ( Index  ib) const
inlineoverridevirtual

Get the iterator corresponding to the end of the given row of blocks.

◆ bRowRange()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual std::pair<ColBlockConstIterator, ColBlockConstIterator> sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bRowRange ( Index  ib) const
inlineoverridevirtual

Get the iterators corresponding to the beginning and end of the given row of blocks.

◆ bRowsBegin()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual RowBlockConstIterator sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bRowsBegin ( ) const
inlineoverridevirtual

Get the iterator corresponding to the beginning of the rows of blocks.

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ bRowsEnd()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual RowBlockConstIterator sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bRowsEnd ( ) const
inlineoverridevirtual

Get the iterator corresponding to the end of the rows of blocks.

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ bRowSize()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual Index sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bRowSize ( ) const
inlineoverridevirtual
Returns
the number of rows of blocks

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ bRowsRange()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual std::pair<RowBlockConstIterator, RowBlockConstIterator> sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::bRowsRange ( ) const
inlineoverridevirtual

Get the iterators corresponding to the beginning and end of the given row of blocks.

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ clear() [1/2]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::clear ( )
inlineoverridevirtual

Completely clear the matrix.

Need implement clear to override BaseMatrix one.

Implements sofa::linearalgebra::BaseMatrix.

◆ clear() [2/2]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::clear ( Index  i,
Index  j 
)
inlineoverride

clear scalar at element i, j of matrix

◆ clearCol()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::clearCol ( Index  j)
inlineoverride

Clear col scalar method. Clear this col in all row of matrix.

Parameters
j: Col index considering size of matrix in scalar.
Warning
If you want to clear all value of a block, it is better to call clearColBlock

◆ clearRow()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::clearRow ( Index  i)
inlineoverride

Clear row scalar method. Clear all col of this line.

Parameters
i: Line index considering size of matrix in scalar.
Warning
If you want to clear all value of a block, it is better to call clearRowBlock

◆ clearRowCol()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::clearRowCol ( Index  i)
inlineoverride

Clear both row i and column i in a square matrix.

Parameters
i: Row and Col index considering size of matrix in scalar.

◆ colSize()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
Index sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::colSize ( ) const
inlineoverridevirtual

Number of columns.

Implements sofa::linearalgebra::BaseMatrix.

◆ compress()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::compress ( )
inlineoverridevirtual

Make the final data setup after adding entries. For most concrete types, this method does nothing.

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ copyLower()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::copyLower ( Matrix M,
bool  keepEmptyRows = false 
)
inline

◆ copyLowerNonSmall()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::copyLowerNonSmall ( Matrix M,
const Real  ref,
bool  keepEmptyRows = false 
)
inline

◆ copyLowerNonZeros()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class TMatrix >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::copyLowerNonZeros ( TMatrix &  M,
bool  keepEmptyRows = false 
)
inline

◆ copyNonSmall()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class TMatrix >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::copyNonSmall ( TMatrix &  M,
const Real  ref,
bool  keepEmptyRows = false 
)
inline

◆ copyNonZeros()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class TMatrix >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::copyNonZeros ( TMatrix &  M,
bool  keepEmptyRows = false 
)
inline

◆ copyUpper()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::copyUpper ( Matrix M,
bool  keepEmptyRows = false 
)
inline

◆ copyUpperNonSmall()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::copyUpperNonSmall ( Matrix M,
const Real  ref,
bool  keepEmptyRows = false 
)
inline

◆ copyUpperNonZeros()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class TMatrix >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::copyUpperNonZeros ( TMatrix &  M,
bool  keepEmptyRows = false 
)
inline

◆ element()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
SReal sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::element ( Index  i,
Index  j 
) const
inlineoverride

get scalar element i, j of matrix

◆ equal()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class M >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::equal ( const M &  m,
bool  add = false 
)
inlineprotected

add ? this += m : this = m m can be the same as this

◆ expr()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
std::string sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::expr ( ) const
inline

◆ extend()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::extend ( Index  nbRow,
Index  nbCol 
)
inline

◆ filterValues()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class TMatrix >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::filterValues ( TMatrix &  srcMatrix,
filter_fn filter = &nonzeros,
const Real  ref = Real(),
bool  keepEmptyRows = false 
)
inline

◆ fullDiagonal()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<typename = typename std::enable_if< Policy::IsAlwaysSquare>>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::fullDiagonal ( )
inline

Make sure all diagonal entries are present even if they are zero.

Mathematical size of the matrix

◆ getBandWidth()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual Index sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::getBandWidth ( ) const
inlineoverridevirtual
Returns
the width of the band on each side of the diagonal (only for band matrices)

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ getBlockCols()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual Index sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::getBlockCols ( ) const
inlineoverridevirtual
Returns
the number of columns in each block, or 1 of there are no fixed block size

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ getBlockRows()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual Index sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::getBlockRows ( ) const
inlineoverridevirtual
Returns
the number of rows in each block, or 1 of there are no fixed block size

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ getCategory()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual MatrixCategory sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::getCategory ( ) const
inlineoverridevirtual
Returns
the category of this matrix

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ getElementSize()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual std::size_t sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::getElementSize ( ) const
inlineoverridevirtual
Returns
size of elements stored in this matrix

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ getElementType()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual ElementType sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::getElementType ( ) const
inlineoverridevirtual
Returns
type of elements stored in this matrix

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ hasRef()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class M2 >
bool sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::hasRef ( const M2 *  m) const
inline

◆ itAccessColBlock()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::itAccessColBlock ( InternalColBlockIterator it,
BlockConstAccessor b 
) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ itAccessRowBlock()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual Index sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::itAccessRowBlock ( InternalRowBlockIterator it) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ itBeginRowBlock()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual ColBlockConstIterator sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::itBeginRowBlock ( InternalRowBlockIterator it) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ itCopyColBlock()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::itCopyColBlock ( InternalColBlockIterator ) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ itCopyRowBlock()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::itCopyRowBlock ( InternalRowBlockIterator ) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ itDecColBlock()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::itDecColBlock ( InternalColBlockIterator it) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ itDecRowBlock()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::itDecRowBlock ( InternalRowBlockIterator it) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ itDeleteColBlock()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::itDeleteColBlock ( const InternalColBlockIterator ) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ itDeleteRowBlock()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::itDeleteRowBlock ( const InternalRowBlockIterator ) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ itEndRowBlock()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual ColBlockConstIterator sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::itEndRowBlock ( InternalRowBlockIterator it) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ itEqColBlock()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual bool sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::itEqColBlock ( const InternalColBlockIterator it,
const InternalColBlockIterator it2 
) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ itEqRowBlock()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual bool sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::itEqRowBlock ( const InternalRowBlockIterator it,
const InternalRowBlockIterator it2 
) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ itIncColBlock()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::itIncColBlock ( InternalColBlockIterator it) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ itIncRowBlock()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::itIncRowBlock ( InternalRowBlockIterator it) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ itLessColBlock()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual bool sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::itLessColBlock ( const InternalColBlockIterator it,
const InternalColBlockIterator it2 
) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ itLessRowBlock()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual bool sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::itLessRowBlock ( const InternalRowBlockIterator it,
const InternalRowBlockIterator it2 
) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ itRangeRowBlock()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
virtual std::pair<ColBlockConstIterator, ColBlockConstIterator> sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::itRangeRowBlock ( InternalRowBlockIterator it) const
inlineoverrideprotectedvirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ lower()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
static bool sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::lower ( Index  i,
Index  j,
Block val,
const  Real 
)
inlinestatic

◆ lower_nonsmall()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
static bool sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::lower_nonsmall ( Index  i,
Index  j,
Block val,
const Real  ref 
)
inlinestatic

◆ lower_nonzeros()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
static bool sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::lower_nonzeros ( Index  i,
Index  j,
Block val,
const Real  ref 
)
inlinestatic

◆ mul()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<typename V1 , typename V2 , std::enable_if_t< sofa::type::trait::is_vector< V1 >::value &&sofa::type::trait::is_vector< V2 >::value, int > = 0>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::mul ( V2 &  result,
const V1 &  v 
) const
inline

equal result = this * v

Warning
The block sizes must be compatible ie v.size() must be a multiple of block size.

◆ Name()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
static const char* sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::Name ( )
inlinestatic

◆ nonsmall()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
static bool sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::nonsmall ( Index  ,
Index  ,
Block val,
const Real  ref 
)
inlinestatic

◆ nonzeros()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
static bool sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::nonzeros ( Index  ,
Index  ,
Block val,
const  Real 
)
inlinestatic

◆ operator*() [1/2]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
MatrixExpr< MatrixScale< Matrix, double > > sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::operator* ( const double &  r) const
inline

◆ operator*() [2/2]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Vec >
Vec sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::operator* ( const Vec v) const
inline
Returns
this * v
Warning
The block sizes must be compatible ie v.size() must be a multiple of block size.

◆ operator+()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
CompressedRowSparseMatrixMechanical<TBlock, TPolicy> sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::operator+ ( const CompressedRowSparseMatrixMechanical< TBlock, TPolicy > &  m) const
inline
Returns
this + m
Warning
The block must be the same (same type and same size)
The matrices must have the same mathematical size
matrices this and m must be compressed

◆ operator+=() [1/2]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class TBlock2 , class TPolicy2 >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::operator+= ( const CompressedRowSparseMatrixMechanical< TBlock2, TPolicy2 > &  m)
inline

◆ operator+=() [2/2]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Expr2 >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::operator+= ( const MatrixExpr< Expr2 > &  m)
inline

◆ operator-()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
MatrixExpr< MatrixNegative< Matrix > > sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::operator- ( ) const
inline

◆ operator-=() [1/2]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class TBlock2 , class TPolicy2 >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::operator-= ( const CompressedRowSparseMatrixMechanical< TBlock2, TPolicy2 > &  m)
inline

◆ operator-=() [2/2]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Expr2 >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::operator-= ( const MatrixExpr< Expr2 > &  m)
inline

◆ operator=() [1/2]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class TBlock2 , class TPolicy2 >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::operator= ( const CompressedRowSparseMatrixMechanical< TBlock2, TPolicy2 > &  m)
inline

◆ operator=() [2/2]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Expr2 >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::operator= ( const MatrixExpr< Expr2 > &  m)
inline

◆ resize()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::resize ( Index  nbRow,
Index  nbCol 
)
inlineoverride

◆ resizeBlock()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::resizeBlock ( Index  nbBRow,
Index  nbBCol 
)
inlineoverridevirtual

This override classic resizeBlock to fill nRow and nCol values.

Reimplemented from sofa::linearalgebra::CompressedRowSparseMatrixGeneric< TBlock, CRSMechanicalPolicy >.

◆ rowSize()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
Index sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::rowSize ( void  ) const
inlineoverridevirtual

Mathematical size of the matrix.

Implements sofa::linearalgebra::BaseMatrix.

◆ set() [1/2]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::set ( Index  i,
Index  j,
double  v 
)
inlineoverride

set scalar element i, j of matrix

◆ set() [2/2]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::set ( Index  i,
Index  j,
int &  rowId,
int &  colId,
double  v 
)
inline

set scalar element i, j of matrix when rowId and colId are known

◆ split_col_index()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
static void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::split_col_index ( Index index,
Index modulo 
)
inlinestatic

◆ split_row_index()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
static void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::split_row_index ( Index index,
Index modulo 
)
inlinestatic

◆ swap()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::swap ( Matrix m)
inline

◆ t()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
MatrixExpr< MatrixTranspose< Matrix > > sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::t ( ) const
inline

◆ taddMul()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Real2 , class V1 , class V2 >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::taddMul ( V1 &  res,
const V2 &  vec 
) const
inlineprotected

Product of the matrix with a templated vector res += this * vec

◆ taddMul_by_line()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Real2 , class V1 , class V2 >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::taddMul_by_line ( V1 &  res,
const V2 &  vec 
) const
inlineprotected

Product of the matrix with a templated vector that have the size of the block res += this * [vec,...,vec]^T

◆ taddMulTranspose()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Real2 , class V1 , class V2 >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::taddMulTranspose ( V1 &  res,
const V2 &  vec 
) const
inlineprotected

Product of the transpose with a templated vector and add it to res res += this^T * vec

◆ tmul()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Real2 , class V1 , class V2 >
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::tmul ( V1 &  res,
const V2 &  vec 
) const
inlineprotected

Product of the matrix with a templated vector res = this * vec Product of the matrix with a templated vector res = this * vec

◆ upper()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
static bool sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::upper ( Index  i,
Index  j,
Block val,
const  Real 
)
inlinestatic

◆ upper_nonsmall()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
static bool sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::upper_nonsmall ( Index  i,
Index  j,
Block val,
const Real  ref 
)
inlinestatic

◆ upper_nonzeros()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
static bool sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::upper_nonzeros ( Index  i,
Index  j,
Block val,
const Real  ref 
)
inlinestatic

◆ vadd() [1/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
static void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vadd ( BaseVector vec,
Index  i,
Real  v 
)
inlinestaticprotected

◆ vadd() [2/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Real2 >
static void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vadd ( FullVector< Real2 > &  vec,
Index  i,
Real2  v 
)
inlinestaticprotected

◆ vadd() [3/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Vec >
static void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vadd ( type::vector< Vec > &  vec,
Index  i,
Index  ,
Index  k,
Real  v 
)
inlinestaticprotected

◆ vadd() [4/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Vec >
static void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vadd ( Vec vec,
Index  i,
Index  j,
Index  k,
Real  v 
)
inlinestaticprotected

◆ valid()

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
bool sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::valid ( ) const
inline

◆ vget() [1/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
static Real sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vget ( const BaseVector vec,
Index  i 
)
inlinestaticprotected

◆ vget() [2/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Real2 >
static Real2 sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vget ( const FullVector< Real2 > &  vec,
Index  i 
)
inlinestaticprotected

◆ vget() [3/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Vec >
static Real sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vget ( const type::vector< Vec > &  vec,
Index  i,
Index  ,
Index  k 
)
inlinestaticprotected

◆ vget() [4/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Vec >
static Real sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vget ( const Vec vec,
Index  i,
Index  j,
Index  k 
)
inlinestaticprotected

◆ vresize() [1/2]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Vec >
static void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vresize ( type::vector< Vec > &  vec,
Index  blockSize,
Index   
)
inlinestaticprotected

◆ vresize() [2/2]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Vec >
static void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vresize ( Vec vec,
Index  ,
Index  totalSize 
)
inlinestaticprotected

◆ vset() [1/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
static void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vset ( BaseVector vec,
Index  i,
Real  v 
)
inlinestaticprotected

◆ vset() [2/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Real2 >
static void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vset ( FullVector< Real2 > &  vec,
Index  i,
Real2  v 
)
inlinestaticprotected

◆ vset() [3/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Vec >
static void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vset ( type::vector< Vec > &  vec,
Index  i,
Index  ,
Index  k,
Real  v 
)
inlinestaticprotected

◆ vset() [4/4]

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
template<class Vec >
static void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::vset ( Vec vec,
Index  i,
Index  j,
Index  k,
Real  v 
)
inlinestaticprotected

Enum details

◆ anonymous enum

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
anonymous enum
Enumerator
category 

◆ anonymous enum

template<typename TBlock , typename TPolicy = CRSMechanicalPolicy>
anonymous enum
Enumerator
operand