SOFA API  59c939c2
Open source framework for multi-physics simuation
sofa::defaulttype::MapMapSparseMatrix< T > Class Template Reference

#include <MapMapSparseMatrix.h>

Inheritance diagram for sofa::defaulttype::MapMapSparseMatrix< T >:

Classes

class  ColConstIterator
 Sparse Matrix columns constant Iterator. More...
 
class  ColIterator
 
class  RowConstIterator
 
class  RowIterator
 

Protected Attributes

SparseMatrix m_data
 Data container. More...
 

Public Member Functions

void clear ()
 Removes every matrix elements. More...
 
bool empty () const
 
std::size_t size () const
 
template<class VecDeriv >
void multTransposeBaseVector (VecDeriv &res, const sofa::defaulttype::BaseVector *lambda) const
 
RowConstIterator begin () const
 
RowConstIterator end () const
 
RowIterator begin ()
 
RowIterator end ()
 
RowConstIterator readLine (KeyType lIndex) const
 
RowIterator writeLine (KeyType lIndex)
 
std::pair< RowIterator, boolwriteLine (KeyType lIndex, RowType row)
 
std::pair< RowIterator, booladdLine (KeyType lIndex, RowType row)
 
RowIterator newLine ()
 

Friends

std::ostream & operator<< (std::ostream &out, const MapMapSparseMatrix< T > &sc)
 write to an output stream More...
 
std::istream & operator>> (std::istream &in, MapMapSparseMatrix< T > &sc)
 read from an input stream More...
 

Attribute details

template<class T>
SparseMatrix sofa::defaulttype::MapMapSparseMatrix< T >::m_data
protected

Data container.

Function details

template<class T>
std::pair< RowIterator, bool > sofa::defaulttype::MapMapSparseMatrix< T >::addLine ( KeyType  lIndex,
RowType  row 
)
inline
Returns
Pair of Iterator on specified row and boolean on true if addition took place
Parameters
lIndexrow Index
rowconstraint itself If lindex doesn't exists, creates the row
template<class T>
RowConstIterator sofa::defaulttype::MapMapSparseMatrix< T >::begin ( ) const
inline
template<class T>
RowIterator sofa::defaulttype::MapMapSparseMatrix< T >::begin ( )
inline
template<class T>
void sofa::defaulttype::MapMapSparseMatrix< T >::clear ( )
inline

Removes every matrix elements.

template<class T>
bool sofa::defaulttype::MapMapSparseMatrix< T >::empty ( ) const
inline
Returns
true if the matrix is empty
template<class T>
RowConstIterator sofa::defaulttype::MapMapSparseMatrix< T >::end ( ) const
inline
template<class T>
RowIterator sofa::defaulttype::MapMapSparseMatrix< T >::end ( )
inline
template<class T>
template<class VecDeriv >
void sofa::defaulttype::MapMapSparseMatrix< T >::multTransposeBaseVector ( VecDeriv &  res,
const sofa::defaulttype::BaseVector lambda 
) const
inline
template<class T>
RowIterator sofa::defaulttype::MapMapSparseMatrix< T >::newLine ( )
inline
Returns
Iterator on new allocated row Creates a new row in the sparse matrix with the last+1 key index
template<class T>
RowConstIterator sofa::defaulttype::MapMapSparseMatrix< T >::readLine ( KeyType  lIndex) const
inline
Returns
Constant Iterator on specified row
Parameters
lIndexrow index If lIndex row doesn't exist, returns end iterator
template<class T>
std::size_t sofa::defaulttype::MapMapSparseMatrix< T >::size ( void  ) const
inline
Returns
the number of rows
template<class T>
RowIterator sofa::defaulttype::MapMapSparseMatrix< T >::writeLine ( KeyType  lIndex)
inline
Returns
Iterator on specified row
Parameters
lIndexrow index If lIndex row doesn't exist, creates the line and returns an iterator on it
template<class T>
std::pair< RowIterator, bool > sofa::defaulttype::MapMapSparseMatrix< T >::writeLine ( KeyType  lIndex,
RowType  row 
)
inline
Returns
Pair of Iterator on specified row and boolean on true if insertion took place
Parameters
lIndexrow Index
rowconstraint itself If lindex already exists, overwrite existing constraint

Related details

template<class T>
std::ostream& operator<< ( std::ostream &  out,
const MapMapSparseMatrix< T > &  sc 
)
friend

write to an output stream

template<class T>
std::istream& operator>> ( std::istream &  in,
MapMapSparseMatrix< T > &  sc 
)
friend

read from an input stream