SparseMatrix< _Scalar, _Flags > Class Template Reference

Sparse matrix. More...

#include <SparseMatrix.h>

Inheritance diagram for SparseMatrix< _Scalar, _Flags >:
Inheritance graph
[legend]

List of all members.

Classes

class  InnerIterator

Public Types

typedef std::pair< int, int > IndexType
typedef MappedSparseMatrix
< Scalar, Flags > 
Map

Public Member Functions

int * _innerIndexPtr ()
const int * _innerIndexPtr () const
int * _outerIndexPtr ()
const int * _outerIndexPtr () const
Scalar_valuePtr ()
const Scalar_valuePtr () const
virtual ScalarTypeA (int row, int col)
 return the value of the matrix
Scalar coeff (int row, int col) const
ScalarcoeffRef (int row, int col)
int cols () const
virtual void CreateSparse (std::vector< IndexType > Entries)
void endFill ()
Scalarfill (int row, int col)
Scalarfillrand (int row, int col)
virtual void Initalize (int dimension)
 initilaization of the system
int innerNonZeros (int j) const
int innerSize () const
virtual bool IsSymmetric ()
 return true if the rapresention of sparse matriz is symmetric
int nonZeros () const
template<typename OtherDerived >
SparseMatrixoperator= (const SparseMatrixBase< OtherDerived > &other)
SparseMatrixoperator= (const SparseMatrix &other)
int outerSize () const
void prune (Scalar reference, RealScalar epsilon=precision< RealScalar >())
void resize (int rows, int cols)
void resizeNonZeros (int size)
int rows () const
void setZero ()
virtual int Size ()
 return the dimension of the matrix
 SparseMatrix (const SparseMatrix &other)
template<typename OtherDerived >
 SparseMatrix (const SparseMatrixBase< OtherDerived > &other)
 SparseMatrix (int rows, int cols)
 SparseMatrix ()
void startFill (int reserveSize=1000)
void swap (SparseMatrix &other)
virtual void Zero ()
 ~SparseMatrix ()

Public Attributes

std::vector< int > _Ai
std::vector< int > _Ap
std::vector< double > _Ax
int _dimension

Protected Types

enum  { IsRowMajor = Base::IsRowMajor }
typedef SparseMatrix< Scalar,(Flags
&~RowMajorBit)|(IsRowMajor?RowMajorBit:0)> 
TransposedSparseMatrix

Protected Attributes

CompressedStorage< Scalarm_data
int m_innerSize
int * m_outerIndex
int m_outerSize

Friends

std::ostream & operator<< (std::ostream &s, const SparseMatrix &m)

Detailed Description

template<typename _Scalar, int _Flags>
class SparseMatrix< _Scalar, _Flags >

Sparse matrix.

this class define the interface to use sparse matrix you must extend this class and implement the code of each function in order to the system solver you're using. For details on implementation see system_interface_LDL.h as example

Parameters:
_Scalar the scalar type, i.e. the type of the coefficients

See http://www.netlib.org/linalg/html_templates/node91.html for details on the storage scheme.

Definition at line 55 of file SparseMatrix.h.


Member Typedef Documentation

template<typename _Scalar, int _Flags>
typedef std::pair<int,int> SparseMatrix< _Scalar, _Flags >::IndexType

Definition at line 19 of file sparse_matrix.h.

template<typename _Scalar, int _Flags>
typedef MappedSparseMatrix<Scalar,Flags> SparseMatrix< _Scalar, _Flags >::Map

Definition at line 66 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
typedef SparseMatrix<Scalar,(Flags&~RowMajorBit)|(IsRowMajor?RowMajorBit:0)> SparseMatrix< _Scalar, _Flags >::TransposedSparseMatrix [protected]

Definition at line 71 of file SparseMatrix.h.


Member Enumeration Documentation

template<typename _Scalar, int _Flags>
anonymous enum [protected]
Enumerator:
IsRowMajor 

Definition at line 70 of file SparseMatrix.h.


Constructor & Destructor Documentation

template<typename _Scalar, int _Flags>
SparseMatrix< _Scalar, _Flags >::SparseMatrix (  )  [inline]

Definition at line 283 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
SparseMatrix< _Scalar, _Flags >::SparseMatrix ( int  rows,
int  cols 
) [inline]

Definition at line 289 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
template<typename OtherDerived >
SparseMatrix< _Scalar, _Flags >::SparseMatrix ( const SparseMatrixBase< OtherDerived > &  other  )  [inline]

Definition at line 296 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
SparseMatrix< _Scalar, _Flags >::SparseMatrix ( const SparseMatrix< _Scalar, _Flags > &  other  )  [inline]

Definition at line 302 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
SparseMatrix< _Scalar, _Flags >::~SparseMatrix (  )  [inline]

Destructor

Definition at line 410 of file SparseMatrix.h.


Member Function Documentation

template<typename _Scalar, int _Flags>
int* SparseMatrix< _Scalar, _Flags >::_innerIndexPtr (  )  [inline]

Definition at line 91 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
const int* SparseMatrix< _Scalar, _Flags >::_innerIndexPtr (  )  const [inline]

Definition at line 90 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
int* SparseMatrix< _Scalar, _Flags >::_outerIndexPtr (  )  [inline]

Definition at line 94 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
const int* SparseMatrix< _Scalar, _Flags >::_outerIndexPtr (  )  const [inline]

Definition at line 93 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
Scalar* SparseMatrix< _Scalar, _Flags >::_valuePtr (  )  [inline]

Definition at line 88 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
const Scalar* SparseMatrix< _Scalar, _Flags >::_valuePtr (  )  const [inline]

Definition at line 87 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
virtual ScalarType& SparseMatrix< _Scalar, _Flags >::A ( int  row,
int  col 
) [inline, virtual]

return the value of the matrix

Reimplemented in SystemLDL.

Definition at line 35 of file sparse_matrix.h.

template<typename _Scalar, int _Flags>
Scalar SparseMatrix< _Scalar, _Flags >::coeff ( int  row,
int  col 
) const [inline]

Definition at line 96 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
Scalar& SparseMatrix< _Scalar, _Flags >::coeffRef ( int  row,
int  col 
) [inline]

Definition at line 103 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
int SparseMatrix< _Scalar, _Flags >::cols ( void   )  const [inline]
Returns:
the number of columns.
See also:
rows(), ColsAtCompileTime

Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Flags > >.

Definition at line 81 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
virtual void SparseMatrix< _Scalar, _Flags >::CreateSparse ( std::vector< IndexType Entries  )  [inline, virtual]

create a sparse matrix given a set of entries as vector of pair of int

Reimplemented in SystemLDL.

Definition at line 31 of file sparse_matrix.h.

template<typename _Scalar, int _Flags>
void SparseMatrix< _Scalar, _Flags >::endFill (  )  [inline]

Definition at line 225 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
Scalar& SparseMatrix< _Scalar, _Flags >::fill ( int  row,
int  col 
) [inline]

Definition at line 147 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
Scalar& SparseMatrix< _Scalar, _Flags >::fillrand ( int  row,
int  col 
) [inline]

Like fill() but with random inner coordinates.

Definition at line 177 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
virtual void SparseMatrix< _Scalar, _Flags >::Initalize ( int  dimension  )  [inline, virtual]

initilaization of the system

Reimplemented in SystemLDL.

Definition at line 26 of file sparse_matrix.h.

template<typename _Scalar, int _Flags>
int SparseMatrix< _Scalar, _Flags >::innerNonZeros ( int  j  )  const [inline]

Definition at line 85 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
int SparseMatrix< _Scalar, _Flags >::innerSize (  )  const [inline]
Returns:
the size of the inner dimension according to the storage order, i.e., the number of rows for a columns major matrix, and the number of cols otherwise

Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Flags > >.

Definition at line 83 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
virtual bool SparseMatrix< _Scalar, _Flags >::IsSymmetric (  )  [inline, virtual]

return true if the rapresention of sparse matriz is symmetric

Reimplemented in SystemLDL.

Definition at line 39 of file sparse_matrix.h.

template<typename _Scalar, int _Flags>
int SparseMatrix< _Scalar, _Flags >::nonZeros (  )  const [inline]
Returns:
the number of non zero coefficients

Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Flags > >.

Definition at line 133 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
template<typename OtherDerived >
SparseMatrix& SparseMatrix< _Scalar, _Flags >::operator= ( const SparseMatrixBase< OtherDerived > &  other  )  [inline]

Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Flags > >.

Definition at line 334 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
SparseMatrix& SparseMatrix< _Scalar, _Flags >::operator= ( const SparseMatrix< _Scalar, _Flags > &  other  )  [inline]

Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Flags > >.

Definition at line 317 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
int SparseMatrix< _Scalar, _Flags >::outerSize (  )  const [inline]
Returns:
the size of the storage major dimension, i.e., the number of columns for a columns major matrix, and the number of rows otherwise

Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Flags > >.

Definition at line 84 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
void SparseMatrix< _Scalar, _Flags >::prune ( Scalar  reference,
RealScalar  epsilon = precision<RealScalar>() 
) [inline]

Definition at line 240 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
void SparseMatrix< _Scalar, _Flags >::resize ( int  rows,
int  cols 
) [inline]

Resizes the matrix to a rows x cols matrix and initializes it to zero

See also:
resizeNonZeros(int), reserve(), setZero()

Definition at line 265 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
void SparseMatrix< _Scalar, _Flags >::resizeNonZeros ( int  size  )  [inline]

Definition at line 278 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
int SparseMatrix< _Scalar, _Flags >::rows ( void   )  const [inline]
Returns:
the number of rows.
See also:
cols(), RowsAtCompileTime

Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Flags > >.

Definition at line 80 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
void SparseMatrix< _Scalar, _Flags >::setZero (  )  [inline]

Definition at line 121 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
virtual int SparseMatrix< _Scalar, _Flags >::Size (  )  [inline, virtual]

return the dimension of the matrix

Reimplemented in SystemLDL.

Definition at line 46 of file sparse_matrix.h.

template<typename _Scalar, int _Flags>
void SparseMatrix< _Scalar, _Flags >::startFill ( int  reserveSize = 1000  )  [inline]

Initializes the filling process of *this.

Parameters:
reserveSize approximate number of nonzeros Note that the matrix *this is zero-ed.

Definition at line 139 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
void SparseMatrix< _Scalar, _Flags >::swap ( SparseMatrix< _Scalar, _Flags > &  other  )  [inline]

Definition at line 308 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
virtual void SparseMatrix< _Scalar, _Flags >::Zero (  )  [inline, virtual]

Reimplemented in SystemLDL.

Definition at line 42 of file sparse_matrix.h.


Friends And Related Function Documentation

template<typename _Scalar, int _Flags>
std::ostream& operator<< ( std::ostream &  s,
const SparseMatrix< _Scalar, _Flags > &  m 
) [friend]

Definition at line 387 of file SparseMatrix.h.


Member Data Documentation

template<typename _Scalar, int _Flags>
std::vector<int> SparseMatrix< _Scalar, _Flags >::_Ai

Definition at line 16 of file sparse_matrix.h.

template<typename _Scalar, int _Flags>
std::vector<int> SparseMatrix< _Scalar, _Flags >::_Ap

Definition at line 15 of file sparse_matrix.h.

template<typename _Scalar, int _Flags>
std::vector<double> SparseMatrix< _Scalar, _Flags >::_Ax

Definition at line 17 of file sparse_matrix.h.

template<typename _Scalar, int _Flags>
int SparseMatrix< _Scalar, _Flags >::_dimension

Definition at line 21 of file sparse_matrix.h.

template<typename _Scalar, int _Flags>
CompressedStorage<Scalar> SparseMatrix< _Scalar, _Flags >::m_data [protected]

Definition at line 76 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
int SparseMatrix< _Scalar, _Flags >::m_innerSize [protected]

Definition at line 74 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
int* SparseMatrix< _Scalar, _Flags >::m_outerIndex [protected]

Definition at line 75 of file SparseMatrix.h.

template<typename _Scalar, int _Flags>
int SparseMatrix< _Scalar, _Flags >::m_outerSize [protected]

Definition at line 73 of file SparseMatrix.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


vcglib
Author(s): Christian Bersch
autogenerated on Fri Jan 11 09:22:24 2013