Sparse matrix. More...
#include <SparseMatrix.h>
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 ScalarType & | A (int row, int col) |
return the value of the matrix | |
Scalar | coeff (int row, int col) const |
Scalar & | coeffRef (int row, int col) |
int | cols () const |
virtual void | CreateSparse (std::vector< IndexType > Entries) |
void | endFill () |
Scalar & | fill (int row, int col) |
Scalar & | fillrand (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 > | |
SparseMatrix & | operator= (const SparseMatrixBase< OtherDerived > &other) |
SparseMatrix & | operator= (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< Scalar > | m_data |
int | m_innerSize |
int * | m_outerIndex |
int | m_outerSize |
Friends | |
std::ostream & | operator<< (std::ostream &s, const SparseMatrix &m) |
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
_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.
typedef std::pair<int,int> SparseMatrix< _Scalar, _Flags >::IndexType |
Definition at line 19 of file sparse_matrix.h.
typedef MappedSparseMatrix<Scalar,Flags> SparseMatrix< _Scalar, _Flags >::Map |
Definition at line 66 of file SparseMatrix.h.
typedef SparseMatrix<Scalar,(Flags&~RowMajorBit)|(IsRowMajor?RowMajorBit:0)> SparseMatrix< _Scalar, _Flags >::TransposedSparseMatrix [protected] |
Definition at line 71 of file SparseMatrix.h.
anonymous enum [protected] |
Definition at line 70 of file SparseMatrix.h.
SparseMatrix< _Scalar, _Flags >::SparseMatrix | ( | ) | [inline] |
Definition at line 283 of file SparseMatrix.h.
SparseMatrix< _Scalar, _Flags >::SparseMatrix | ( | int | rows, | |
int | cols | |||
) | [inline] |
Definition at line 289 of file SparseMatrix.h.
SparseMatrix< _Scalar, _Flags >::SparseMatrix | ( | const SparseMatrixBase< OtherDerived > & | other | ) | [inline] |
Definition at line 296 of file SparseMatrix.h.
SparseMatrix< _Scalar, _Flags >::SparseMatrix | ( | const SparseMatrix< _Scalar, _Flags > & | other | ) | [inline] |
Definition at line 302 of file SparseMatrix.h.
SparseMatrix< _Scalar, _Flags >::~SparseMatrix | ( | ) | [inline] |
Destructor
Definition at line 410 of file SparseMatrix.h.
int* SparseMatrix< _Scalar, _Flags >::_innerIndexPtr | ( | ) | [inline] |
Definition at line 91 of file SparseMatrix.h.
const int* SparseMatrix< _Scalar, _Flags >::_innerIndexPtr | ( | ) | const [inline] |
Definition at line 90 of file SparseMatrix.h.
int* SparseMatrix< _Scalar, _Flags >::_outerIndexPtr | ( | ) | [inline] |
Definition at line 94 of file SparseMatrix.h.
const int* SparseMatrix< _Scalar, _Flags >::_outerIndexPtr | ( | ) | const [inline] |
Definition at line 93 of file SparseMatrix.h.
Scalar* SparseMatrix< _Scalar, _Flags >::_valuePtr | ( | ) | [inline] |
Definition at line 88 of file SparseMatrix.h.
const Scalar* SparseMatrix< _Scalar, _Flags >::_valuePtr | ( | ) | const [inline] |
Definition at line 87 of file SparseMatrix.h.
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.
Scalar SparseMatrix< _Scalar, _Flags >::coeff | ( | int | row, | |
int | col | |||
) | const [inline] |
Definition at line 96 of file SparseMatrix.h.
Scalar& SparseMatrix< _Scalar, _Flags >::coeffRef | ( | int | row, | |
int | col | |||
) | [inline] |
Definition at line 103 of file SparseMatrix.h.
int SparseMatrix< _Scalar, _Flags >::cols | ( | void | ) | const [inline] |
Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Flags > >.
Definition at line 81 of file SparseMatrix.h.
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.
void SparseMatrix< _Scalar, _Flags >::endFill | ( | ) | [inline] |
Definition at line 225 of file SparseMatrix.h.
Scalar& SparseMatrix< _Scalar, _Flags >::fill | ( | int | row, | |
int | col | |||
) | [inline] |
Definition at line 147 of file SparseMatrix.h.
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.
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.
int SparseMatrix< _Scalar, _Flags >::innerNonZeros | ( | int | j | ) | const [inline] |
Definition at line 85 of file SparseMatrix.h.
int SparseMatrix< _Scalar, _Flags >::innerSize | ( | ) | const [inline] |
Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Flags > >.
Definition at line 83 of file SparseMatrix.h.
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.
int SparseMatrix< _Scalar, _Flags >::nonZeros | ( | ) | const [inline] |
Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Flags > >.
Definition at line 133 of file SparseMatrix.h.
SparseMatrix& SparseMatrix< _Scalar, _Flags >::operator= | ( | const SparseMatrixBase< OtherDerived > & | other | ) | [inline] |
Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Flags > >.
Definition at line 334 of file SparseMatrix.h.
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.
int SparseMatrix< _Scalar, _Flags >::outerSize | ( | ) | const [inline] |
Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Flags > >.
Definition at line 84 of file SparseMatrix.h.
void SparseMatrix< _Scalar, _Flags >::prune | ( | Scalar | reference, | |
RealScalar | epsilon = precision<RealScalar>() | |||
) | [inline] |
Definition at line 240 of file SparseMatrix.h.
void SparseMatrix< _Scalar, _Flags >::resize | ( | int | rows, | |
int | cols | |||
) | [inline] |
Resizes the matrix to a rows x cols matrix and initializes it to zero
Definition at line 265 of file SparseMatrix.h.
void SparseMatrix< _Scalar, _Flags >::resizeNonZeros | ( | int | size | ) | [inline] |
Definition at line 278 of file SparseMatrix.h.
int SparseMatrix< _Scalar, _Flags >::rows | ( | void | ) | const [inline] |
Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Flags > >.
Definition at line 80 of file SparseMatrix.h.
void SparseMatrix< _Scalar, _Flags >::setZero | ( | ) | [inline] |
Definition at line 121 of file SparseMatrix.h.
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.
void SparseMatrix< _Scalar, _Flags >::startFill | ( | int | reserveSize = 1000 |
) | [inline] |
Initializes the filling process of *this
.
reserveSize | approximate number of nonzeros Note that the matrix *this is zero-ed. |
Definition at line 139 of file SparseMatrix.h.
void SparseMatrix< _Scalar, _Flags >::swap | ( | SparseMatrix< _Scalar, _Flags > & | other | ) | [inline] |
Definition at line 308 of file SparseMatrix.h.
virtual void SparseMatrix< _Scalar, _Flags >::Zero | ( | ) | [inline, virtual] |
Reimplemented in SystemLDL.
Definition at line 42 of file sparse_matrix.h.
std::ostream& operator<< | ( | std::ostream & | s, | |
const SparseMatrix< _Scalar, _Flags > & | m | |||
) | [friend] |
Definition at line 387 of file SparseMatrix.h.
std::vector<int> SparseMatrix< _Scalar, _Flags >::_Ai |
Definition at line 16 of file sparse_matrix.h.
std::vector<int> SparseMatrix< _Scalar, _Flags >::_Ap |
Definition at line 15 of file sparse_matrix.h.
std::vector<double> SparseMatrix< _Scalar, _Flags >::_Ax |
Definition at line 17 of file sparse_matrix.h.
int SparseMatrix< _Scalar, _Flags >::_dimension |
Definition at line 21 of file sparse_matrix.h.
CompressedStorage<Scalar> SparseMatrix< _Scalar, _Flags >::m_data [protected] |
Definition at line 76 of file SparseMatrix.h.
int SparseMatrix< _Scalar, _Flags >::m_innerSize [protected] |
Definition at line 74 of file SparseMatrix.h.
int* SparseMatrix< _Scalar, _Flags >::m_outerIndex [protected] |
Definition at line 75 of file SparseMatrix.h.
int SparseMatrix< _Scalar, _Flags >::m_outerSize [protected] |
Definition at line 73 of file SparseMatrix.h.