SparseVector< _Scalar, _Flags > Class Template Reference

a sparse vector class More...

#include <SparseVector.h>

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

List of all members.

Classes

class  InnerIterator

Public Types

enum  { IsColVector = ei_traits<SparseVector>::IsColVector }
typedef SparseMatrixBase
< SparseVector
SparseBase

Public Member Functions

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

Public Attributes

CompressedStorage< Scalarm_data
int m_size

Friends

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

Detailed Description

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

a sparse vector class

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 SparseVector.h.


Member Typedef Documentation

template<typename _Scalar , int _Flags>
typedef SparseMatrixBase<SparseVector> SparseVector< _Scalar, _Flags >::SparseBase

Definition at line 67 of file SparseVector.h.


Member Enumeration Documentation

template<typename _Scalar , int _Flags>
anonymous enum
Enumerator:
IsColVector 

Definition at line 68 of file SparseVector.h.


Constructor & Destructor Documentation

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

Definition at line 193 of file SparseVector.h.

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

Definition at line 195 of file SparseVector.h.

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

Definition at line 197 of file SparseVector.h.

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

Definition at line 200 of file SparseVector.h.

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

Definition at line 207 of file SparseVector.h.

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

Definition at line 213 of file SparseVector.h.

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

Destructor

Definition at line 326 of file SparseVector.h.


Member Function Documentation

template<typename _Scalar , int _Flags>
CompressedStorage<Scalar>& SparseVector< _Scalar, _Flags >::_data (  )  const [inline]

Definition at line 74 of file SparseVector.h.

template<typename _Scalar , int _Flags>
CompressedStorage<Scalar>& SparseVector< _Scalar, _Flags >::_data (  )  [inline]

Definition at line 73 of file SparseVector.h.

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

Definition at line 88 of file SparseVector.h.

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

Definition at line 87 of file SparseVector.h.

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

Definition at line 85 of file SparseVector.h.

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

Definition at line 84 of file SparseVector.h.

template<typename _Scalar , int _Flags>
Scalar SparseVector< _Scalar, _Flags >::coeff ( int  i  )  const [inline]

Definition at line 95 of file SparseVector.h.

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

Definition at line 90 of file SparseVector.h.

template<typename _Scalar , int _Flags>
Scalar& SparseVector< _Scalar, _Flags >::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.

Definition at line 109 of file SparseVector.h.

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

Definition at line 97 of file SparseVector.h.

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

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

Definition at line 79 of file SparseVector.h.

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

Definition at line 172 of file SparseVector.h.

template<typename _Scalar , int _Flags>
Scalar& SparseVector< _Scalar, _Flags >::fill ( int  i  )  [inline]

Definition at line 141 of file SparseVector.h.

template<typename _Scalar , int _Flags>
Scalar& SparseVector< _Scalar, _Flags >::fill ( int  r,
int  c 
) [inline]

Definition at line 135 of file SparseVector.h.

template<typename _Scalar , int _Flags>
Scalar& SparseVector< _Scalar, _Flags >::fillrand ( int  i  )  [inline]

Like fill() but with random coordinates.

Definition at line 155 of file SparseVector.h.

template<typename _Scalar , int _Flags>
Scalar& SparseVector< _Scalar, _Flags >::fillrand ( int  r,
int  c 
) [inline]

Definition at line 147 of file SparseVector.h.

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

Definition at line 82 of file SparseVector.h.

template<typename _Scalar , int _Flags>
EIGEN_STRONG_INLINE int SparseVector< _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< SparseVector< _Scalar, _Flags > >.

Definition at line 80 of file SparseVector.h.

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

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

Definition at line 121 of file SparseVector.h.

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

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

Definition at line 240 of file SparseVector.h.

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

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

Definition at line 225 of file SparseVector.h.

template<typename _Scalar , int _Flags>
EIGEN_STRONG_INLINE int SparseVector< _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< SparseVector< _Scalar, _Flags > >.

Definition at line 81 of file SparseVector.h.

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

Definition at line 174 of file SparseVector.h.

template<typename _Scalar , int _Flags>
void SparseVector< _Scalar, _Flags >::reserve ( int  reserveSize  )  [inline]

Definition at line 125 of file SparseVector.h.

template<typename _Scalar , int _Flags>
void SparseVector< _Scalar, _Flags >::resize ( int  newSize  )  [inline]

Definition at line 185 of file SparseVector.h.

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

Definition at line 179 of file SparseVector.h.

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

Definition at line 191 of file SparseVector.h.

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

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

Definition at line 78 of file SparseVector.h.

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

Definition at line 118 of file SparseVector.h.

template<typename _Scalar , int _Flags>
void SparseVector< _Scalar, _Flags >::startFill ( int  reserve  )  [inline]

Definition at line 127 of file SparseVector.h.

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

Definition at line 219 of file SparseVector.h.


Friends And Related Function Documentation

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

Definition at line 295 of file SparseVector.h.


Member Data Documentation

template<typename _Scalar , int _Flags>
CompressedStorage<Scalar> SparseVector< _Scalar, _Flags >::m_data

Definition at line 70 of file SparseVector.h.

template<typename _Scalar , int _Flags>
int SparseVector< _Scalar, _Flags >::m_size

Definition at line 71 of file SparseVector.h.


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


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