Namespaces | |
sparsematrixproduct | |
testing | |
Typedefs | |
typedef BlockDiagonalMatrix< 3 > | BlockDiagonalMatrix3 |
typedef BlockDiagonalMatrix< 6 > | BlockDiagonalMatrix6 |
typedef BlockDiagonalMatrix< 9 > | BlockDiagonalMatrix9 |
typedef BlockDiagonalMatrix< 12 > | BlockDiagonalMatrix12 |
template<typename TBlock , typename TVecBlock = type::vector<TBlock>, typename TVecIndex = type::vector<sofa::Index>> | |
using | CompressedRowSparseMatrix = CompressedRowSparseMatrixMechanical< TBlock, CRSMechanicalPolicy > |
Enumerations | |
enum | MatrixCategory { MATRIX_IDENTITY = 0 , MATRIX_DIAGONAL , MATRIX_BAND , MATRIX_SPARSE , MATRIX_FULL } |
Functions | |
template<sofa::Size L, sofa::Size C, class real > | |
void | matrixAdd (BaseMatrix *self, const Index row, const Index col, const sofa::type::Mat< L, C, real > &M) |
std::ostream & | operator<< (std::ostream &out, const sofa::linearalgebra::BaseMatrix &m) |
Declare that the operator >> exists but is defined in a BaseMatrix.cpp. More... | |
std::istream & | operator>> (std::istream &in, sofa::linearalgebra::BaseMatrix &m) |
Declare that the operator >> exists but is defined in a BaseMatrix.cpp. More... | |
std::ostream & | operator<< (std::ostream &out, const BaseVector &v) |
Declare that the operator << exists but is defined in BaseVector.cpp. More... | |
template<class RowType , class VecDeriv , typename Real = typename VecDeriv::value_type::Real> | |
Real | CompressedRowSparseMatrixVecDerivMult (const RowType row, const VecDeriv &vec) |
template<class RowType , class VecDeriv > | |
void | convertCompressedRowSparseMatrixRowToVecDeriv (const RowType row, VecDeriv &out) |
template<typename LhsMatrixDeriv , typename RhsMatrixDeriv , typename Real > | |
void | addMultTransposeEigen (LhsMatrixDeriv &lhs, const Eigen::SparseMatrix< Real, Eigen::RowMajor > &jacobian, const RhsMatrixDeriv &rhs) |
Computes lhs += jacobian^T * rhs. More... | |
template<class TMatrix , class TBlockMatrix > | |
void | addBlockMat (TMatrix &self, Index row, Index col, const TBlockMatrix &_M) |
template<typename Real > | |
void | solveDiagonalSystem (const sofa::Size systemSize, const Real *rightHandSideVector, Real *solution, const Real *const D_values) |
template<typename Real > | |
void | solveDiagonalSystemUsingInvertedValues (const sofa::Size systemSize, const Real *rightHandSideVector, Real *solution, const Real *const Dinv_values) |
std::ostream & | operator<< (std::ostream &out, const FullMatrix< double > &v) |
std::ostream & | operator<< (std::ostream &out, const FullMatrix< float > &v) |
std::ostream & | operator<< (std::ostream &out, const LPtrFullMatrix< double > &v) |
std::ostream & | operator<< (std::ostream &out, const LPtrFullMatrix< float > &v) |
template<typename Real > | |
std::ostream & | readFromStream (std::ostream &out, const FullMatrix< Real > &v) |
std::ostream & | operator<< (std::ostream &out, const FullVector< float > &v) |
std::ostream & | operator<< (std::ostream &out, const FullVector< double > &v) |
template<typename Real > | |
std::ostream & | readFromStream (std::ostream &out, const FullVector< Real > &v) |
SOFA_LINEARALGEBRA_API void | init () |
Initialize the Sofa.LinearAlgebra library, as well as its dependencies: Sofa.Type, SofaHelper. More... | |
SOFA_LINEARALGEBRA_API bool | isInitialized () |
Return true if and only if the Sofa.LinearAlgebra library has been initialized. More... | |
SOFA_LINEARALGEBRA_API void | cleanup () |
Clean up the resources used by the Sofa.LinearAlgebra library, as well as its dependencies: Sofa.Type, SofaHelper. More... | |
SOFA_LINEARALGEBRA_API bool | isCleanedUp () |
Return true if and only if the Sofa.LinearAlgebra library has been cleaned up. More... | |
template<class Real > | |
std::ostream & | operator<< (std::ostream &out, const RotationMatrix< Real > &v) |
template SOFA_LINEARALGEBRA_API std::ostream & | operator<< (std::ostream &out, const RotationMatrix< float > &v) |
template SOFA_LINEARALGEBRA_API std::ostream & | operator<< (std::ostream &out, const RotationMatrix< double > &v) |
template<typename _Scalar , int _Options, typename _StorageIndex > | |
void | flagValueIndices (Eigen::SparseMatrix< sparsematrixproduct::IndexedValue< _Scalar >, _Options, _StorageIndex > &matrix) |
template<class TMatrix > | |
void | transpose (const TMatrix &self, type::vector< typename TMatrix::Index > &outer, type::vector< typename TMatrix::Index > &inner, type::vector< typename TMatrix::Index > &perm) |
template<typename Real , typename Integer > | |
void | solveLowerUnitriangularSystemCSR (const sofa::Size systemSize, const Real *rightHandSideVector, Real *solutionVector, const Integer *const CSR_rows, const Integer *const CSR_columns, const Real *const CSR_values) |
template<typename Real , typename Integer > | |
void | solveUpperUnitriangularSystemCSR (const sofa::Size systemSize, const Real *rightHandSideVector, Real *solutionVector, const Integer *const CSR_rows, const Integer *const CSR_columns, const Real *const CSR_values) |
void | computeRowColumnCoordinateFromIndexInLowerTriangularMatrix (const sofa::Index flatIndex, sofa::Index &row, sofa::Index &col) |
Variables | |
template class SOFA_LINEARALGEBRA_API | BlockDiagonalMatrix< 3, SReal > |
template class SOFA_LINEARALGEBRA_API | BlockFullMatrix< 6, SReal > |
template class SOFA_LINEARALGEBRA_API | CompressedRowSparseMatrixGeneric< double > |
template class SOFA_LINEARALGEBRA_API | CompressedRowSparseMatrixGeneric< float > |
template class SOFA_LINEARALGEBRA_API | CompressedRowSparseMatrixMechanical< float > |
template class SOFA_LINEARALGEBRA_API | CompressedRowSparseMatrixMechanical< Mat1x1f > |
template class SOFA_LINEARALGEBRA_API | CompressedRowSparseMatrixMechanical< Mat2x2f > |
template class SOFA_LINEARALGEBRA_API | CompressedRowSparseMatrixMechanical< Mat3x3f > |
template class SOFA_LINEARALGEBRA_API | CompressedRowSparseMatrixMechanical< Mat4x4f > |
template class SOFA_LINEARALGEBRA_API | CompressedRowSparseMatrixMechanical< Mat< 6, 6, float > > |
template class SOFA_LINEARALGEBRA_API | CompressedRowSparseMatrixMechanical< Mat< 8, 8, float > > |
template class SOFA_LINEARALGEBRA_API | CompressedRowSparseMatrixMechanical< double > |
template class SOFA_LINEARALGEBRA_API | CompressedRowSparseMatrixMechanical< Mat1x1d > |
template class SOFA_LINEARALGEBRA_API | CompressedRowSparseMatrixMechanical< Mat2x2d > |
template class SOFA_LINEARALGEBRA_API | CompressedRowSparseMatrixMechanical< Mat3x3d > |
template class SOFA_LINEARALGEBRA_API | CompressedRowSparseMatrixMechanical< Mat4x4d > |
template class SOFA_LINEARALGEBRA_API | CompressedRowSparseMatrixMechanical< Mat< 6, 6, double > > |
template class SOFA_LINEARALGEBRA_API | CompressedRowSparseMatrixMechanical< Mat< 8, 8, double > > |
template class SOFA_LINEARALGEBRA_API | FullMatrix< double > |
template class SOFA_LINEARALGEBRA_API | FullMatrix< float > |
template class SOFA_LINEARALGEBRA_API | LPtrFullMatrix< double > |
template class SOFA_LINEARALGEBRA_API | LPtrFullMatrix< float > |
template class SOFA_LINEARALGEBRA_API | FullVector< float > |
template class SOFA_LINEARALGEBRA_API | FullVector< double > |
template class SOFA_LINEARALGEBRA_API | RotationMatrix< float > |
template class SOFA_LINEARALGEBRA_API | RotationMatrix< double > |
using sofa::linearalgebra::CompressedRowSparseMatrix = typedef CompressedRowSparseMatrixMechanical<TBlock, CRSMechanicalPolicy> |
void sofa::linearalgebra::addBlockMat | ( | TMatrix & | self, |
Index | row, | ||
Index | col, | ||
const TBlockMatrix & | _M | ||
) |
void sofa::linearalgebra::addMultTransposeEigen | ( | LhsMatrixDeriv & | lhs, |
const Eigen::SparseMatrix< Real, Eigen::RowMajor > & | jacobian, | ||
const RhsMatrixDeriv & | rhs | ||
) |
Computes lhs += jacobian^T * rhs.
SOFA_LINEARALGEBRA_API void sofa::linearalgebra::cleanup | ( | ) |
Clean up the resources used by the Sofa.LinearAlgebra library, as well as its dependencies: Sofa.Type, SofaHelper.
Real sofa::linearalgebra::CompressedRowSparseMatrixVecDerivMult | ( | const RowType | row, |
const VecDeriv & | vec | ||
) |
|
inline |
A lower triangular matrix can be stored as a linear array. This function converts the index in this linear array to 2d coordinates (row and column) of an element in the matrix.
Example of a 6x6 lower triangular matrix: [ 0 ] [ 1 2 ] [ 3 4 5 ] [ 6 7 8 9 ] [10 11 12 13 14 ] [15 16 17 18 19 20]
0 => (0, 0) 7 => (3, 1) 18 => (5, 3)
void sofa::linearalgebra::convertCompressedRowSparseMatrixRowToVecDeriv | ( | const RowType | row, |
VecDeriv & | out | ||
) |
void sofa::linearalgebra::flagValueIndices | ( | Eigen::SparseMatrix< sparsematrixproduct::IndexedValue< _Scalar >, _Options, _StorageIndex > & | matrix | ) |
SOFA_LINEARALGEBRA_API void sofa::linearalgebra::init | ( | ) |
Initialize the Sofa.LinearAlgebra library, as well as its dependencies: Sofa.Type, SofaHelper.
SOFA_LINEARALGEBRA_API bool sofa::linearalgebra::isCleanedUp | ( | ) |
Return true if and only if the Sofa.LinearAlgebra library has been cleaned up.
SOFA_LINEARALGEBRA_API bool sofa::linearalgebra::isInitialized | ( | ) |
Return true if and only if the Sofa.LinearAlgebra library has been initialized.
void sofa::linearalgebra::matrixAdd | ( | BaseMatrix * | self, |
const Index | row, | ||
const Index | col, | ||
const sofa::type::Mat< L, C, real > & | M | ||
) |
SOFA_LINEARALGEBRA_API std::ostream & sofa::linearalgebra::operator<< | ( | std::ostream & | out, |
const BaseVector & | v | ||
) |
Declare that the operator << exists but is defined in BaseVector.cpp.
SOFA_LINEARALGEBRA_API std::ostream & sofa::linearalgebra::operator<< | ( | std::ostream & | out, |
const FullMatrix< double > & | v | ||
) |
SOFA_LINEARALGEBRA_API std::ostream & sofa::linearalgebra::operator<< | ( | std::ostream & | out, |
const FullMatrix< float > & | v | ||
) |
SOFA_LINEARALGEBRA_API std::ostream & sofa::linearalgebra::operator<< | ( | std::ostream & | out, |
const FullVector< double > & | v | ||
) |
SOFA_LINEARALGEBRA_API std::ostream & sofa::linearalgebra::operator<< | ( | std::ostream & | out, |
const FullVector< float > & | v | ||
) |
SOFA_LINEARALGEBRA_API std::ostream & sofa::linearalgebra::operator<< | ( | std::ostream & | out, |
const LPtrFullMatrix< double > & | v | ||
) |
SOFA_LINEARALGEBRA_API std::ostream & sofa::linearalgebra::operator<< | ( | std::ostream & | out, |
const LPtrFullMatrix< float > & | v | ||
) |
template SOFA_LINEARALGEBRA_API std::ostream & sofa::linearalgebra::operator<< | ( | std::ostream & | out, |
const RotationMatrix< double > & | v | ||
) |
template SOFA_LINEARALGEBRA_API std::ostream & sofa::linearalgebra::operator<< | ( | std::ostream & | out, |
const RotationMatrix< float > & | v | ||
) |
std::ostream & sofa::linearalgebra::operator<< | ( | std::ostream & | out, |
const RotationMatrix< Real > & | v | ||
) |
SOFA_LINEARALGEBRA_API std::ostream & sofa::linearalgebra::operator<< | ( | std::ostream & | out, |
const sofa::linearalgebra::BaseMatrix & | m | ||
) |
Declare that the operator >> exists but is defined in a BaseMatrix.cpp.
Declare that the operator << is friend so they can use private data.
SOFA_LINEARALGEBRA_API std::istream & sofa::linearalgebra::operator>> | ( | std::istream & | in, |
sofa::linearalgebra::BaseMatrix & | m | ||
) |
Declare that the operator >> exists but is defined in a BaseMatrix.cpp.
Declare that the operator >> is friend so they can use private data.
std::ostream& sofa::linearalgebra::readFromStream | ( | std::ostream & | out, |
const FullMatrix< Real > & | v | ||
) |
std::ostream& sofa::linearalgebra::readFromStream | ( | std::ostream & | out, |
const FullVector< Real > & | v | ||
) |
void sofa::linearalgebra::solveDiagonalSystem | ( | const sofa::Size | systemSize, |
const Real * | rightHandSideVector, | ||
Real * | solution, | ||
const Real *const | D_values | ||
) |
Solves a linear system D*x = b, where: D is a diagonal matrix x is the solution vector b is the right-hand side vector The diagonal matrix is stored as the list of entries in the diagonal
void sofa::linearalgebra::solveDiagonalSystemUsingInvertedValues | ( | const sofa::Size | systemSize, |
const Real * | rightHandSideVector, | ||
Real * | solution, | ||
const Real *const | Dinv_values | ||
) |
Solves a linear system D*x = b, where: D is a diagonal matrix x is the solution vector b is the right-hand side vector The diagonal matrix is stored as the list of the inverse of the entries in the diagonal
void sofa::linearalgebra::solveLowerUnitriangularSystemCSR | ( | const sofa::Size | systemSize, |
const Real * | rightHandSideVector, | ||
Real * | solutionVector, | ||
const Integer *const | CSR_rows, | ||
const Integer *const | CSR_columns, | ||
const Real *const | CSR_values | ||
) |
Solves a lower unitriangular system where the matrix is represented in CSR format
Forward substitution is used to solve a linear system L*x = b, where: L is a lower unitriangular matrix x is the solution vector b is the right-hand side vector The lower unitriangular matrix must be provided in compressed sparse row (CSR) format
systemSize | The size of the system. All other parameters must comply with this size |
rightHandSideVector | The right-hand side vector |
solutionVector | The solution vector |
CSR_rows | The array storing the starting index of each row in the data array. |
CSR_columns | The array storing the column indices of the nonzero values in the data array. |
CSR_values | The array containing the nonzero values of the matrix |
void sofa::linearalgebra::solveUpperUnitriangularSystemCSR | ( | const sofa::Size | systemSize, |
const Real * | rightHandSideVector, | ||
Real * | solutionVector, | ||
const Integer *const | CSR_rows, | ||
const Integer *const | CSR_columns, | ||
const Real *const | CSR_values | ||
) |
Solves a upper unitriangular system where the matrix is represented in CSR format
Backward substitution is used to solve a linear system U*x = b, where: U is a upper unitriangular matrix x is the solution vector b is the right-hand side vector The upper unitriangular matrix must be provided in compressed sparse row (CSR) format
systemSize | The size of the system. All other parameters must comply with this size |
rightHandSideVector | The right-hand side vector |
solutionVector | The solution vector |
CSR_rows | The array storing the starting index of each row in the data array. |
CSR_columns | The array storing the column indices of the nonzero values in the data array. |
CSR_values | The array containing the nonzero values of the matrix |
void sofa::linearalgebra::transpose | ( | const TMatrix & | self, |
type::vector< typename TMatrix::Index > & | outer, | ||
type::vector< typename TMatrix::Index > & | inner, | ||
type::vector< typename TMatrix::Index > & | perm | ||
) |
|
extern |
|
extern |
template class SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixGeneric< double > |
template class SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixGeneric< float > |
template class SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< double > |
template class SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< float > |
template class SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< Mat1x1d > |
template class SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< Mat1x1f > |
template class SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< Mat2x2d > |
template class SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< Mat2x2f > |
template class SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< Mat3x3d > |
template class SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< Mat3x3f > |
template class SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< Mat4x4d > |
template class SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< Mat4x4f > |
template class SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< Mat< 6, 6, double > > |
template class SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< Mat< 6, 6, float > > |
template class SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< Mat< 8, 8, double > > |
template class SOFA_LINEARALGEBRA_API sofa::linearalgebra::CompressedRowSparseMatrixMechanical< Mat< 8, 8, float > > |
|
extern |
|
extern |
template class SOFA_LINEARALGEBRA_API sofa::linearalgebra::FullVector< double > |
template class SOFA_LINEARALGEBRA_API sofa::linearalgebra::FullVector< float > |
|
extern |
|
extern |
template class SOFA_LINEARALGEBRA_API sofa::linearalgebra::RotationMatrix< double > |
template class SOFA_LINEARALGEBRA_API sofa::linearalgebra::RotationMatrix< float > |