SOFA API  1a4bb3e7
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::linearalgebra::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

◆ m_data

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

Data container.

Function details

◆ addLine()

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

◆ begin() [1/2]

template<class T >
RowIterator sofa::defaulttype::MapMapSparseMatrix< T >::begin ( )
inline

◆ begin() [2/2]

template<class T >
RowConstIterator sofa::defaulttype::MapMapSparseMatrix< T >::begin ( ) const
inline

◆ clear()

template<class T >
void sofa::defaulttype::MapMapSparseMatrix< T >::clear ( )
inline

Removes every matrix elements.

◆ empty()

template<class T >
bool sofa::defaulttype::MapMapSparseMatrix< T >::empty ( ) const
inline
Returns
true if the matrix is empty

◆ end() [1/2]

template<class T >
RowIterator sofa::defaulttype::MapMapSparseMatrix< T >::end ( )
inline

◆ end() [2/2]

template<class T >
RowConstIterator sofa::defaulttype::MapMapSparseMatrix< T >::end ( ) const
inline

◆ multTransposeBaseVector()

template<class T >
template<class VecDeriv >
void sofa::defaulttype::MapMapSparseMatrix< T >::multTransposeBaseVector ( VecDeriv &  res,
const sofa::linearalgebra::BaseVector lambda 
) const
inline

◆ newLine()

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

◆ readLine()

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

◆ size()

template<class T >
std::size_t sofa::defaulttype::MapMapSparseMatrix< T >::size ( ) const
inline
Returns
the number of rows

◆ writeLine() [1/2]

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

◆ writeLine() [2/2]

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

◆ operator<<

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

write to an output stream

◆ operator>>

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

read from an input stream