sofa::defaulttype::BaseMatrix Class Reference

Generic matrix API, allowing to fill and use a matrix independently of the linear algebra library in use. More...

#include <BaseMatrix.h>

Inheritance diagram for sofa::defaulttype::BaseMatrix:

Inheritance graph
[legend]

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.

Detailed Description

Generic matrix API, allowing to fill and use a matrix independently of the linear algebra library in use.

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.


Constructor & Destructor Documentation

virtual sofa::defaulttype::BaseMatrix::~BaseMatrix (  )  [inline, virtual]

Definition at line 43 of file BaseMatrix.h.


Member Function Documentation

virtual void sofa::defaulttype::BaseMatrix::add ( int  i,
int  j,
double  v 
) [pure virtual]

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()().

virtual void sofa::defaulttype::BaseMatrix::clear ( int  i,
int  j 
) [inline, virtual]

virtual void sofa::defaulttype::BaseMatrix::clear (  )  [pure virtual]

virtual void sofa::defaulttype::BaseMatrix::clearCol ( int  j  )  [inline, virtual]

virtual void sofa::defaulttype::BaseMatrix::clearRow ( int  i  )  [inline, virtual]

virtual void sofa::defaulttype::BaseMatrix::clearRowCol ( int  i  )  [inline, virtual]

virtual int sofa::defaulttype::BaseMatrix::colSize ( void   )  const [pure virtual]

virtual SReal sofa::defaulttype::BaseMatrix::element ( int  i,
int  j 
) const [pure virtual]

virtual void sofa::defaulttype::BaseMatrix::resize ( int  nbRow,
int  nbCol 
) [pure virtual]

virtual int sofa::defaulttype::BaseMatrix::rowSize ( void   )  const [pure virtual]

virtual void sofa::defaulttype::BaseMatrix::set ( int  i,
int  j,
double  v 
) [pure virtual]


The documentation for this class was generated from the following file:

Generated on Sun Nov 23 04:23:50 2008 for Sofa by  doxygen 1.5.7.1