#include <BaseMatrix.h>

Public Member Functions | |
| virtual | ~BaseMatrix () |
| virtual int | rowSize (void) const =0 |
| Number of rows. | |
| virtual int | colSize (void) const =0 |
| Number of columns. | |
| virtual SReal | element (int i, int j) const =0 |
| Read the value of the element at row i, column j (using 0-based indices). | |
| virtual void | resize (int nbRow, int nbCol)=0 |
| Resize the matrix and reset all values to 0. | |
| virtual void | clear ()=0 |
| Reset all values to 0. | |
| virtual void | set (int i, int j, double v)=0 |
| Write the value of the element at row i, column j (using 0-based indices). | |
| virtual void | add (int i, int j, double v)=0 |
| Add v to the existing value of the element at row i, column j (using 0-based indices). | |
| virtual void | clear (int i, int j) |
| virtual void | clearRow (int i) |
| Reset the value of row i to 0. | |
| virtual void | clearCol (int j) |
| Reset the value of column j to 0. | |
| virtual void | clearRowCol (int i) |
| Reset the value of both row and column i to 0. | |
Note that accessing values using this class is rather slow and should only be used in codes where the provided genericity is necessary.
Definition at line 40 of file BaseMatrix.h.
| virtual sofa::defaulttype::BaseMatrix::~BaseMatrix | ( | ) | [inline, virtual] |
Definition at line 43 of file BaseMatrix.h.
Add v to the existing value of the element at row i, column j (using 0-based indices).
Implemented in sofa::component::linearsolver::FullMatrix< T >, sofa::component::linearsolver::TNewMatMatrix< Mat >, sofa::component::linearsolver::SparseMatrix< T >, sofa::gpu::cuda::CudaBaseMatrix< T >, sofa::component::linearsolver::FullMatrix< double >, sofa::component::linearsolver::SparseMatrix< double >, sofa::component::linearsolver::TNewMatMatrix< Mat >, sofa::component::linearsolver::TNewMatMatrix< Mat >, and sofa::component::linearsolver::TNewMatMatrix< Mat >.
Referenced by sofa::component::forcefield::TetrahedronFEMForceField< DataTypes >::addKToMatrix(), sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::addKToMatrix(), sofa::component::forcefield::HexahedronFEMForceField< DataTypes >::addKToMatrix(), sofa::component::forcefield::BeamFEMForceField< DataTypes >::addKToMatrix(), sofa::component::constraint::UncoupledConstraintCorrection< TDataTypes >::getCompliance(), sofa::component::constraint::PrecomputedConstraintCorrection< TDataTypes >::getCompliance(), sofa::component::mass::AddMToMatrixFunctor< defaulttype::RigidDeriv< 2, Real >, defaulttype::RigidMass< 2, Real > >::operator()(), sofa::component::mass::AddMToMatrixFunctor< defaulttype::RigidDeriv< 3, Real >, defaulttype::RigidMass< 3, Real > >::operator()(), sofa::component::mass::AddMToMatrixFunctor< defaulttype::Vec< N, Real >, defaulttype::Mat< N, N, Real > >::operator()(), and sofa::component::mass::AddMToMatrixFunctor< Deriv, MassType >::operator()().
Reimplemented in sofa::component::linearsolver::FullMatrix< T >, sofa::component::linearsolver::TNewMatMatrix< Mat >, sofa::component::linearsolver::SparseMatrix< T >, sofa::component::linearsolver::FullMatrix< double >, and sofa::component::linearsolver::SparseMatrix< double >.
Definition at line 64 of file BaseMatrix.h.
| virtual void sofa::defaulttype::BaseMatrix::clear | ( | ) | [pure virtual] |
Reset all values to 0.
Implemented in sofa::component::linearsolver::FullMatrix< T >, sofa::component::linearsolver::TNewMatMatrix< Mat >, sofa::component::linearsolver::SparseMatrix< T >, sofa::gpu::cuda::CudaBaseMatrix< T >, sofa::component::linearsolver::FullMatrix< double >, and sofa::component::linearsolver::SparseMatrix< double >.
Referenced by clearCol(), and clearRow().
| virtual void sofa::defaulttype::BaseMatrix::clearCol | ( | int | j | ) | [inline, virtual] |
Reset the value of column j to 0.
Reimplemented in sofa::component::linearsolver::FullMatrix< T >, sofa::component::linearsolver::TNewMatMatrix< Mat >, sofa::component::linearsolver::SparseMatrix< T >, sofa::component::linearsolver::FullMatrix< double >, and sofa::component::linearsolver::SparseMatrix< double >.
Definition at line 68 of file BaseMatrix.h.
References clear(), and rowSize().
Referenced by clearRowCol().
| virtual void sofa::defaulttype::BaseMatrix::clearRow | ( | int | i | ) | [inline, virtual] |
Reset the value of row i to 0.
Reimplemented in sofa::component::linearsolver::FullMatrix< T >, sofa::component::linearsolver::TNewMatMatrix< Mat >, sofa::component::linearsolver::SparseMatrix< T >, sofa::component::linearsolver::FullMatrix< double >, and sofa::component::linearsolver::SparseMatrix< double >.
Definition at line 66 of file BaseMatrix.h.
References clear(), and colSize().
Referenced by clearRowCol().
| virtual void sofa::defaulttype::BaseMatrix::clearRowCol | ( | int | i | ) | [inline, virtual] |
Reset the value of both row and column i to 0.
Reimplemented in sofa::component::linearsolver::FullMatrix< T >, sofa::component::linearsolver::TNewMatMatrix< Mat >, sofa::component::linearsolver::SparseMatrix< T >, sofa::component::linearsolver::FullMatrix< double >, and sofa::component::linearsolver::SparseMatrix< double >.
Definition at line 70 of file BaseMatrix.h.
References clearCol(), and clearRow().
Referenced by sofa::component::constraint::FixedConstraint< DataTypes >::applyConstraint(), and sofa::component::constraint::AttachConstraint< DataTypes >::applyConstraint().
| virtual int sofa::defaulttype::BaseMatrix::colSize | ( | void | ) | const [pure virtual] |
Number of columns.
Implemented in sofa::component::linearsolver::FullMatrix< T >, sofa::component::linearsolver::TNewMatMatrix< Mat >, sofa::component::linearsolver::SparseMatrix< T >, sofa::gpu::cuda::CudaBaseMatrix< T >, sofa::component::linearsolver::FullMatrix< double >, and sofa::component::linearsolver::SparseMatrix< double >.
Referenced by clearRow(), and sofa::simulation::OdeSolverImpl::m_print().
Read the value of the element at row i, column j (using 0-based indices).
Implemented in sofa::component::linearsolver::FullMatrix< T >, sofa::component::linearsolver::TNewMatMatrix< Mat >, sofa::component::linearsolver::SparseMatrix< T >, sofa::gpu::cuda::CudaBaseMatrix< T >, sofa::component::linearsolver::FullMatrix< double >, sofa::component::linearsolver::SparseMatrix< double >, sofa::component::linearsolver::TNewMatMatrix< Mat >, and sofa::component::linearsolver::TNewMatMatrix< Mat >.
Referenced by sofa::simulation::OdeSolverImpl::m_print().
Resize the matrix and reset all values to 0.
Implemented in sofa::component::linearsolver::FullMatrix< T >, sofa::component::linearsolver::LPtrFullMatrix< T >, sofa::component::linearsolver::MKLMatrix, sofa::component::linearsolver::TNewMatMatrix< Mat >, sofa::component::linearsolver::SparseMatrix< T >, sofa::gpu::cuda::CudaBaseMatrix< T >, sofa::component::linearsolver::FullMatrix< double >, sofa::component::linearsolver::LPtrFullMatrix< double >, sofa::component::linearsolver::SparseMatrix< double >, sofa::component::linearsolver::TNewMatMatrix< Mat >, sofa::component::linearsolver::TNewMatMatrix< Mat >, and sofa::component::linearsolver::TNewMatMatrix< Mat >.
| virtual int sofa::defaulttype::BaseMatrix::rowSize | ( | void | ) | const [pure virtual] |
Number of rows.
Implemented in sofa::component::linearsolver::FullMatrix< T >, sofa::component::linearsolver::TNewMatMatrix< Mat >, sofa::component::linearsolver::SparseMatrix< T >, sofa::gpu::cuda::CudaBaseMatrix< T >, sofa::component::linearsolver::FullMatrix< double >, and sofa::component::linearsolver::SparseMatrix< double >.
Referenced by clearCol(), sofa::component::constraint::LinearSolverConstraintCorrection< TDataTypes >::getCompliance(), and sofa::simulation::OdeSolverImpl::m_print().
Write the value of the element at row i, column j (using 0-based indices).
Implemented in sofa::component::linearsolver::FullMatrix< T >, sofa::component::linearsolver::TNewMatMatrix< Mat >, sofa::component::linearsolver::SparseMatrix< T >, sofa::gpu::cuda::CudaBaseMatrix< T >, sofa::component::linearsolver::FullMatrix< double >, sofa::component::linearsolver::SparseMatrix< double >, sofa::component::linearsolver::TNewMatMatrix< Mat >, sofa::component::linearsolver::TNewMatMatrix< Mat >, and sofa::component::linearsolver::TNewMatMatrix< Mat >.
Referenced by sofa::component::constraint::FixedConstraint< DataTypes >::applyConstraint(), and sofa::component::constraint::AttachConstraint< DataTypes >::applyConstraint().
1.5.7.1