sofa::component::linearsolver::SparseMatrix< T > Class Template Reference

#include <SparseMatrix.h>

Inheritance diagram for sofa::component::linearsolver::SparseMatrix< T >:

Inheritance graph
[legend]
Collaboration diagram for sofa::component::linearsolver::SparseMatrix< T >:

Collaboration graph
[legend]

Public Types

typedef T Real
typedef int Index
typedef std::map< Index, Real > Line
typedef std::map< Index, Line > Data
typedef Line::iterator LElementIterator
typedef Line::const_iterator LElementConstIterator
typedef Data::iterator LineIterator
typedef Data::const_iterator LineConstIterator

Public Member Functions

 SparseMatrix ()
 SparseMatrix (int nbRow, int nbCol)
LineIterator begin ()
LineIterator end ()
LineConstIterator begin () const
LineConstIterator end () const
Line & operator[] (Index i)
const Line & operator[] (Index i) const
void resize (int nbRow, int nbCol)
 Resize the matrix and reset all values to 0.
int rowSize (void) const
 Number of rows.
int colSize (void) const
 Number of columns.
SReal element (int i, int j) const
 Read the value of the element at row i, column j (using 0-based indices).
void set (int i, int j, double v)
 Write the value of the element at row i, column j (using 0-based indices).
void add (int i, int j, double v)
 Add v to the existing value of the element at row i, column j (using 0-based indices).
void clear (int i, int j)
void clearRow (int i)
 Reset the value of row i to 0.
void clearCol (int j)
 Reset the value of column j to 0.
void clearRowCol (int i)
 Reset the value of both row and column i to 0.
void clear ()
 Reset all values to 0.
template<class Real2 >
void mul (FullVector< Real2 > &res, const FullVector< Real2 > &v) const
template<class Real2 >
void mulTranspose (FullVector< Real2 > &res, const FullVector< Real2 > &v) const
template<class Real2 >
void mul (FullVector< Real2 > &res, const defaulttype::BaseVector *v) const
template<class Real2 >
void mulTranspose (FullVector< Real2 > &res, const defaulttype::BaseVector *v) const
template<class Real2 >
void mul (defaulttype::BaseVector *res, const FullVector< Real2 > &v) const
template<class Real2 >
void mulTranspose (defaulttype::BaseVector *res, const FullVector< Real2 > &v) const
void mul (defaulttype::BaseVector *res, const defaulttype::BaseVector *v) const
void mulTranspose (defaulttype::BaseVector *res, const defaulttype::BaseVector *v) const
template<class Real2 >
FullVector< Real2 > operator* (const FullVector< Real2 > &v) const

Static Public Member Functions

static const char * Name ()

Protected Attributes

Data data
Index nRow
Index nCol

Friends

std::ostream & operator<< (std::ostream &out, const SparseMatrix< T > &v)

Detailed Description

template<typename T>
class sofa::component::linearsolver::SparseMatrix< T >

Definition at line 47 of file SparseMatrix.h.


Member Typedef Documentation

template<typename T >
typedef std::map<Index,Line> sofa::component::linearsolver::SparseMatrix< T >::Data

Definition at line 53 of file SparseMatrix.h.

template<typename T >
typedef int sofa::component::linearsolver::SparseMatrix< T >::Index

Definition at line 51 of file SparseMatrix.h.

template<typename T >
typedef Line::const_iterator sofa::component::linearsolver::SparseMatrix< T >::LElementConstIterator

Definition at line 55 of file SparseMatrix.h.

template<typename T >
typedef Line::iterator sofa::component::linearsolver::SparseMatrix< T >::LElementIterator

Definition at line 54 of file SparseMatrix.h.

template<typename T >
typedef std::map<Index,Real> sofa::component::linearsolver::SparseMatrix< T >::Line

Definition at line 52 of file SparseMatrix.h.

template<typename T >
typedef Data::const_iterator sofa::component::linearsolver::SparseMatrix< T >::LineConstIterator

Definition at line 57 of file SparseMatrix.h.

template<typename T >
typedef Data::iterator sofa::component::linearsolver::SparseMatrix< T >::LineIterator

Definition at line 56 of file SparseMatrix.h.

template<typename T >
typedef T sofa::component::linearsolver::SparseMatrix< T >::Real

Definition at line 50 of file SparseMatrix.h.


Constructor & Destructor Documentation

template<typename T >
sofa::component::linearsolver::SparseMatrix< T >::SparseMatrix (  )  [inline]

Definition at line 65 of file SparseMatrix.h.

template<typename T >
sofa::component::linearsolver::SparseMatrix< T >::SparseMatrix ( int  nbRow,
int  nbCol 
) [inline]

Definition at line 70 of file SparseMatrix.h.


Member Function Documentation

template<typename T >
void sofa::component::linearsolver::SparseMatrix< T >::add ( int  i,
int  j,
double  v 
) [inline, virtual]

Add v to the existing value of the element at row i, column j (using 0-based indices).

Implements sofa::defaulttype::BaseMatrix.

Definition at line 149 of file SparseMatrix.h.

template<typename T >
LineConstIterator sofa::component::linearsolver::SparseMatrix< T >::begin (  )  const [inline]

Definition at line 77 of file SparseMatrix.h.

template<typename T >
LineIterator sofa::component::linearsolver::SparseMatrix< T >::begin (  )  [inline]

template<typename T >
void sofa::component::linearsolver::SparseMatrix< T >::clear (  )  [inline, virtual]

Reset all values to 0.

Implements sofa::defaulttype::BaseMatrix.

Definition at line 241 of file SparseMatrix.h.

template<typename T >
void sofa::component::linearsolver::SparseMatrix< T >::clear ( int  i,
int  j 
) [inline, virtual]

Reimplemented from sofa::defaulttype::BaseMatrix.

Definition at line 164 of file SparseMatrix.h.

template<typename T >
void sofa::component::linearsolver::SparseMatrix< T >::clearCol ( int  j  )  [inline, virtual]

Reset the value of column j to 0.

Reimplemented from sofa::defaulttype::BaseMatrix.

Definition at line 205 of file SparseMatrix.h.

Referenced by sofa::component::linearsolver::SparseMatrix< double >::clearRowCol().

template<typename T >
void sofa::component::linearsolver::SparseMatrix< T >::clearRow ( int  i  )  [inline, virtual]

Reset the value of row i to 0.

Reimplemented from sofa::defaulttype::BaseMatrix.

Definition at line 187 of file SparseMatrix.h.

Referenced by sofa::component::linearsolver::SparseMatrix< double >::clearRowCol().

template<typename T >
void sofa::component::linearsolver::SparseMatrix< T >::clearRowCol ( int  i  )  [inline, virtual]

Reset the value of both row and column i to 0.

Reimplemented from sofa::defaulttype::BaseMatrix.

Definition at line 225 of file SparseMatrix.h.

template<typename T >
int sofa::component::linearsolver::SparseMatrix< T >::colSize ( void   )  const [inline, virtual]

template<typename T >
SReal sofa::component::linearsolver::SparseMatrix< T >::element ( int  i,
int  j 
) const [inline, virtual]

Read the value of the element at row i, column j (using 0-based indices).

Implements sofa::defaulttype::BaseMatrix.

Definition at line 116 of file SparseMatrix.h.

template<typename T >
LineConstIterator sofa::component::linearsolver::SparseMatrix< T >::end (  )  const [inline]

Definition at line 78 of file SparseMatrix.h.

template<typename T >
LineIterator sofa::component::linearsolver::SparseMatrix< T >::end (  )  [inline]

template<typename T >
void sofa::component::linearsolver::SparseMatrix< T >::mul ( defaulttype::BaseVector *  res,
const defaulttype::BaseVector *  v 
) const [inline]

Definition at line 318 of file SparseMatrix.h.

template<typename T >
template<class Real2 >
void sofa::component::linearsolver::SparseMatrix< T >::mul ( defaulttype::BaseVector *  res,
const FullVector< Real2 > &  v 
) const [inline]

Definition at line 294 of file SparseMatrix.h.

template<typename T >
template<class Real2 >
void sofa::component::linearsolver::SparseMatrix< T >::mul ( FullVector< Real2 > &  res,
const defaulttype::BaseVector *  v 
) const [inline]

Definition at line 269 of file SparseMatrix.h.

template<typename T >
template<class Real2 >
void sofa::component::linearsolver::SparseMatrix< T >::mul ( FullVector< Real2 > &  res,
const FullVector< Real2 > &  v 
) const [inline]

template<typename T >
void sofa::component::linearsolver::SparseMatrix< T >::mulTranspose ( defaulttype::BaseVector *  res,
const defaulttype::BaseVector *  v 
) const [inline]

Definition at line 330 of file SparseMatrix.h.

template<typename T >
template<class Real2 >
void sofa::component::linearsolver::SparseMatrix< T >::mulTranspose ( defaulttype::BaseVector *  res,
const FullVector< Real2 > &  v 
) const [inline]

Definition at line 307 of file SparseMatrix.h.

template<typename T >
template<class Real2 >
void sofa::component::linearsolver::SparseMatrix< T >::mulTranspose ( FullVector< Real2 > &  res,
const defaulttype::BaseVector *  v 
) const [inline]

Definition at line 282 of file SparseMatrix.h.

template<typename T >
template<class Real2 >
void sofa::component::linearsolver::SparseMatrix< T >::mulTranspose ( FullVector< Real2 > &  res,
const FullVector< Real2 > &  v 
) const [inline]

Definition at line 257 of file SparseMatrix.h.

template<typename T >
static const char* sofa::component::linearsolver::SparseMatrix< T >::Name (  )  [inline, static]

Definition at line 367 of file SparseMatrix.h.

template<typename T >
template<class Real2 >
FullVector<Real2> sofa::component::linearsolver::SparseMatrix< T >::operator* ( const FullVector< Real2 > &  v  )  const [inline]

Definition at line 342 of file SparseMatrix.h.

template<typename T >
const Line& sofa::component::linearsolver::SparseMatrix< T >::operator[] ( Index  i  )  const [inline]

Definition at line 85 of file SparseMatrix.h.

template<typename T >
Line& sofa::component::linearsolver::SparseMatrix< T >::operator[] ( Index  i  )  [inline]

Definition at line 80 of file SparseMatrix.h.

template<typename T >
void sofa::component::linearsolver::SparseMatrix< T >::resize ( int  nbRow,
int  nbCol 
) [inline, virtual]

Resize the matrix and reset all values to 0.

Implements sofa::defaulttype::BaseMatrix.

Definition at line 95 of file SparseMatrix.h.

template<typename T >
int sofa::component::linearsolver::SparseMatrix< T >::rowSize ( void   )  const [inline, virtual]

template<typename T >
void sofa::component::linearsolver::SparseMatrix< T >::set ( int  i,
int  j,
double  v 
) [inline, virtual]

Write the value of the element at row i, column j (using 0-based indices).

Implements sofa::defaulttype::BaseMatrix.

Definition at line 134 of file SparseMatrix.h.


Friends And Related Function Documentation

template<typename T >
std::ostream& operator<< ( std::ostream &  out,
const SparseMatrix< T > &  v 
) [friend]

Definition at line 349 of file SparseMatrix.h.


Field Documentation

template<typename T >
Data sofa::component::linearsolver::SparseMatrix< T >::data [protected]

template<typename T >
Index sofa::component::linearsolver::SparseMatrix< T >::nCol [protected]

template<typename T >
Index sofa::component::linearsolver::SparseMatrix< T >::nRow [protected]


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

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