#include <CompressedRowSparseMatrixMechanical.h>
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 VecIndex & | getRowIndex () const |
const VecIndex & | getRowBegin () const |
Range | getRowRange (Index id) const |
Returns the range of indices from the column indices corresponding to the id-th row. More... | |
const VecIndex & | getColsIndex () const |
const VecBlock & | getColsValue () 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 Block & | block (Index i, Index j) const |
Get block method. More... | |
const Block & | bloc (Index i, Index j) const |
Block * | wblock (Index i, Index j, bool create=false) |
Write block method. More... | |
Block * | wblock (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... | |
Block * | wbloc (Index i, Index j, bool create=false) |
const Block & | getBlock (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) |
Block * | getWBlock (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, ColBlockConstIterator > | bRowRange (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 char * | Name () |
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 char * | Name () |
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, Index > | registerBtempLine (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... | |
Block * | insertBtemp (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 float * | bAccessorPrepareAdd (InternalBlockAccessor *b, float *buffer) |
virtual double * | bAccessorPrepareAdd (InternalBlockAccessor *b, double *buffer) |
virtual int * | bAccessorPrepareAdd (InternalBlockAccessor *b, int *buffer) |
virtual void | bAccessorFinishAdd (InternalBlockAccessor *b, const float *buffer) |
virtual void | bAccessorFinishAdd (InternalBlockAccessor *b, const double *buffer) |
virtual void | bAccessorFinishAdd (InternalBlockAccessor *b, const int *buffer) |
BlockAccessor | createBlockAccessor (Index row, Index col, void *internalPtr=nullptr) |
BlockAccessor | createBlockAccessor (Index row, Index col, Index internalData) |
BlockConstAccessor | createBlockConstAccessor (Index row, Index col, void *internalPtr=nullptr) const |
BlockConstAccessor | createBlockConstAccessor (Index row, Index col, Index internalData) const |
void | setMatrix (BlockAccessor *b) |
void | setMatrix (BlockConstAccessor *b) const |
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, ColBlockConstIterator > | bRowRange (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, RowBlockConstIterator > | bRowsRange () 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 float * | bAccessorElements (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, ColBlockConstIterator > | itRangeRowBlock (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 InternalBlockAccessor * | getInternal (BlockConstAccessor *b) |
static const InternalBlockAccessor * | getInternal (const BlockConstAccessor *b) |
static InternalBlockAccessor * | getInternal (BlockAccessor *b) |
static const InternalBlockAccessor * | getInternal (const BlockAccessor *b) |
static InternalColBlockIterator * | getInternal (ColBlockConstIterator *b) |
static const InternalColBlockIterator * | getInternal (const ColBlockConstIterator *b) |
static InternalRowBlockIterator * | getInternal (RowBlockConstIterator *b) |
static const InternalRowBlockIterator * | getInternal (const RowBlockConstIterator *b) |
|
staticconstexpr |
Number of columns of a block.
Index sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::nCol |
Mathematical size of the matrix, in scalars.
|
staticconstexpr |
Number of rows of a block.
Index sofa::linearalgebra::CompressedRowSparseMatrixMechanical< TBlock, TPolicy >::nRow |
Size.
|
inline |
|
inline |
|
inlineoverride |
|
inlineoverride |
|
inlineoverride |
add scalar v at element i, j of matrix
|
inline |
add scalar v at element i, j when rowId and colId are known
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< type::Mat< 3, 3, double > >::add | ( | Index | row, |
Index | col, | ||
const type::Mat3x3d & | _M | ||
) |
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< type::Mat< 3, 3, float > >::add | ( | Index | row, |
Index | col, | ||
const type::Mat3x3d & | _M | ||
) |
void SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< type::Mat3x3d >::add | ( | Index | row, |
Index | col, | ||
const type::Mat3x3d & | _M | ||
) |
void SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< type::Mat3x3f >::add | ( | Index | row, |
Index | col, | ||
const type::Mat3x3d & | _M | ||
) |
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< type::Mat< 3, 3, double > >::add | ( | Index | row, |
Index | col, | ||
const type::Mat3x3f & | _M | ||
) |
void sofa::linearalgebra::CompressedRowSparseMatrixMechanical< type::Mat< 3, 3, float > >::add | ( | Index | row, |
Index | col, | ||
const type::Mat3x3f & | _M | ||
) |
void SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< type::Mat3x3d >::add | ( | Index | row, |
Index | col, | ||
const type::Mat3x3f & | _M | ||
) |
void SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< type::Mat3x3f >::add | ( | Index | row, |
Index | col, | ||
const type::Mat3x3f & | _M | ||
) |
|
inline |
Override CRSMatrix add method to avoid mis-understanding by compiler with other add method overriding BaseMatrix.
|
inlineprotected |
this += m
|
inline |
result += this * v
|
inline |
result += this * (v,...,v)^T v has the size of one block
|
inline |
|
inline |
equal result += this^T * v
|
inline |
dest += this different block types possible
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
|
inlineprotected |
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineprotected |
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
|
inlineprotected |
|
inlineoverridevirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlinevirtual |
Get write access to a block, possibly creating it.
|
inlinevirtual |
Get read access to a block.
|
inlinevirtual |
Get write access to a block.
|
inlineoverridevirtual |
Get the iterator corresponding to the beginning of the given row of blocks.
|
inlineoverridevirtual |
Get the iterator corresponding to the end of the given row of blocks.
|
inlineoverridevirtual |
Get the iterators corresponding to the beginning and end of the given row of blocks.
|
inlineoverridevirtual |
Get the iterator corresponding to the beginning of the rows of blocks.
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverridevirtual |
Get the iterator corresponding to the end of the rows of blocks.
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverridevirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverridevirtual |
Get the iterators corresponding to the beginning and end of the given row of blocks.
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverridevirtual |
Completely clear the matrix.
Need implement clear to override BaseMatrix one.
Implements sofa::linearalgebra::BaseMatrix.
|
inlineoverride |
clear scalar at element i, j of matrix
|
inlineoverride |
Clear col scalar method. Clear this col in all row of matrix.
j | : Col index considering size of matrix in scalar. |
|
inlineoverride |
Clear row scalar method. Clear all col of this line.
i | : Line index considering size of matrix in scalar. |
|
inlineoverride |
Clear both row i and column i in a square matrix.
i | : Row and Col index considering size of matrix in scalar. |
|
inlineoverridevirtual |
Number of columns.
Implements sofa::linearalgebra::BaseMatrix.
|
inlineoverridevirtual |
Make the final data setup after adding entries. For most concrete types, this method does nothing.
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineoverride |
get scalar element i, j of matrix
|
inlineprotected |
add ? this += m : this = m m can be the same as this
|
inline |
|
inline |
|
inline |
|
inline |
Make sure all diagonal entries are present even if they are zero.
Mathematical size of the matrix
|
inlineoverridevirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverridevirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverridevirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverridevirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverridevirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverridevirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inline |
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlineoverrideprotectedvirtual |
Reimplemented from sofa::linearalgebra::BaseMatrix.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
equal result = this * v
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineoverride |
|
inlineoverridevirtual |
This override classic resizeBlock to fill nRow and nCol values.
Reimplemented from sofa::linearalgebra::CompressedRowSparseMatrixGeneric< TBlock, CRSMechanicalPolicy >.
|
inlineoverridevirtual |
Mathematical size of the matrix.
Implements sofa::linearalgebra::BaseMatrix.
|
inlineoverride |
set scalar element i, j of matrix
|
inline |
set scalar element i, j of matrix when rowId and colId are known
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inlineprotected |
Product of the matrix with a templated vector res += this * vec
|
inlineprotected |
Product of the matrix with a templated vector that have the size of the block res += this * [vec,...,vec]^T
|
inlineprotected |
Product of the transpose with a templated vector and add it to res res += this^T * vec
|
inlineprotected |
Product of the matrix with a templated vector res = this * vec Product of the matrix with a templated vector res = this * vec
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inline |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
anonymous enum |