Public Types | Public Member Functions | Public Attributes | Friends
SparseVector Class Reference

a sparse vector class More...

List of all members.

Public Types

enum  { IsColVector }
typedef SparseMatrixBase
< SparseVector
SparseBase

Public Member Functions

CompressedStorage< Scalar > & _data ()
CompressedStorage< Scalar > & _data () const
const int * _innerIndexPtr () const
int * _innerIndexPtr ()
const Scalar * _valuePtr () const
Scalar * _valuePtr ()
Scalar coeff (int row, int col) const
Scalar coeff (int i) const
Scalar & coeffRef (int row, int col)
Scalar & coeffRef (int i)
int cols () const
void endFill ()
Scalar & fill (int r, int c)
Scalar & fill (int i)
Scalar & fillrand (int r, int c)
Scalar & fillrand (int i)
int innerNonZeros (int j) const
int innerSize () const
int nonZeros () const
SparseVectoroperator= (const SparseVector &other)
template<typename OtherDerived >
SparseVectoroperator= (const SparseMatrixBase< OtherDerived > &other)
int outerSize () const
void prune (Scalar reference, RealScalar epsilon=precision< RealScalar >())
void reserve (int reserveSize)
void resize (int rows, int cols)
void resize (int newSize)
void resizeNonZeros (int size)
int rows () const
void setZero ()
 SparseVector (int size)
 SparseVector (int rows, int cols)
template<typename OtherDerived >
 SparseVector (const MatrixBase< OtherDerived > &other)
template<typename OtherDerived >
 SparseVector (const SparseMatrixBase< OtherDerived > &other)
 SparseVector (const SparseVector &other)
void startFill (int reserve)
void swap (SparseVector &other)
 ~SparseVector ()

Public Attributes

CompressedStorage< Scalar > m_data
int m_size

Friends

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

Detailed Description

a sparse vector class

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

~SparseVector ( ) [inline]

Destructor


Member Function Documentation

Scalar& coeffRef ( int  i) [inline]
Returns:
a reference to the coefficient value at given index i This operation involes a log(rho*size) binary search. If the coefficient does not exist yet, then a sorted insertion into a sequential buffer is performed.

This insertion might be very costly if the number of nonzeros above i is large.

Scalar& fillrand ( int  i) [inline]

Like fill() but with random coordinates.

int nonZeros ( ) const [inline]
Returns:
the number of non zero coefficients

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