Public Types | Public Member Functions | Protected Types | Protected Attributes | Friends
SparseMatrix Class Reference

Sparse matrix. More...

List of all members.

Public Types

typedef MappedSparseMatrix
< Scalar, Flags > 
Map

Public Member Functions

const int * _innerIndexPtr () const
int * _innerIndexPtr ()
const int * _outerIndexPtr () const
int * _outerIndexPtr ()
const Scalar * _valuePtr () const
Scalar * _valuePtr ()
Scalar coeff (int row, int col) const
Scalar & coeffRef (int row, int col)
int cols () const
void endFill ()
Scalar & fill (int row, int col)
Scalar & fillrand (int row, int col)
int innerNonZeros (int j) const
int innerSize () const
int nonZeros () const
SparseMatrixoperator= (const SparseMatrix &other)
template<typename OtherDerived >
SparseMatrixoperator= (const SparseMatrixBase< OtherDerived > &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 ()
 SparseMatrix (int rows, int cols)
template<typename OtherDerived >
 SparseMatrix (const SparseMatrixBase< OtherDerived > &other)
 SparseMatrix (const SparseMatrix &other)
void startFill (int reserveSize=1000)
void swap (SparseMatrix &other)
 ~SparseMatrix ()

Protected Types

enum  { 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)

Detailed Description

Sparse matrix.

Parameters:
_Scalarthe 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.


Constructor & Destructor Documentation

~SparseMatrix ( ) [inline]

Destructor


Member Function Documentation

Scalar& fillrand ( int  row,
int  col 
) [inline]

Like fill() but with random inner coordinates.

int nonZeros ( ) const [inline]
Returns:
the number of non zero coefficients
void 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()
void startFill ( int  reserveSize = 1000) [inline]

Initializes the filling process of *this.

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

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