linalg::sparse_vector< _Tp > Class Template Reference
[Classes and types for basic data management]

Sparse Vector Template Class. More...

#include <linalg.h>

Inheritance diagram for linalg::sparse_vector< _Tp >:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 sparse_vector ()
 sparse_vector (const _Self &__m)
 sparse_vector (const size_t &n)
void setOutputFormat (const linalg_output_format &f)
const linalg_output_formatgetOutputFormat () const
_Selfoperator= (const _Self &x)
const_reference operator[] (size_type i) const MTL_THROW_ASSERTION
reference operator[] (size_type i)
_Selfoperator+= (const _Self &a)
_Selfoperator*= (const _Tp &a)
_Tp & operator*= (const _Self &a)

Protected Attributes

linalg_output_format output_format

Friends

template<typename _Tq >
std::ostream & std::operator<< (std::ostream &s, const sparse_vector< _Tq > &A)


Detailed Description

template<class _Tp>
class linalg::sparse_vector< _Tp >

This class is the base class for all sparse vector storage/computation in the COCONUT environment. It is based on the MTL, but wraps the MTL classes to make changing the matrix library possible (and hopefully not too awkward. The matrix is general rectangular column-major.

Definition at line 611 of file linalg.h.


Constructor & Destructor Documentation

template<class _Tp>
linalg::sparse_vector< _Tp >::sparse_vector (  )  [inline]

The Standard Constructor

Definition at line 635 of file linalg.h.

template<class _Tp>
linalg::sparse_vector< _Tp >::sparse_vector ( const _Self __m  )  [inline]

The Standard Copy Constructor

Definition at line 637 of file linalg.h.

template<class _Tp>
linalg::sparse_vector< _Tp >::sparse_vector ( const size_t &  n  )  [inline]

Constructor, which builds a vector of size n.

Definition at line 644 of file linalg.h.


Member Function Documentation

template<class _Tp>
const linalg_output_format& linalg::sparse_vector< _Tp >::getOutputFormat (  )  const [inline]

This method returns the output format of the sparse vector.

Definition at line 650 of file linalg.h.

template<class _Tp>
_Tp& linalg::sparse_vector< _Tp >::operator*= ( const _Self a  )  [inline]

This operator computes the scalar product of this vector and a.

Definition at line 696 of file linalg.h.

template<class _Tp>
_Self& linalg::sparse_vector< _Tp >::operator*= ( const _Tp &  a  )  [inline]

This operator multiplies this vector by a.

Definition at line 688 of file linalg.h.

template<class _Tp>
_Self& linalg::sparse_vector< _Tp >::operator+= ( const _Self a  )  [inline]

This operator adds a to this vector.

Definition at line 681 of file linalg.h.

template<class _Tp>
_Self& linalg::sparse_vector< _Tp >::operator= ( const _Self x  )  [inline]

The Assignment Operator, which copies the memory structure rather than copying the pointers.

Definition at line 655 of file linalg.h.

template<class _Tp>
reference linalg::sparse_vector< _Tp >::operator[] ( size_type  i  )  [inline]

This operator returns the i-th element of the vector

Definition at line 672 of file linalg.h.

template<class _Tp>
const_reference linalg::sparse_vector< _Tp >::operator[] ( size_type  i  )  const [inline]

This operator returns the i-th element of the vector

Definition at line 666 of file linalg.h.

template<class _Tp>
void linalg::sparse_vector< _Tp >::setOutputFormat ( const linalg_output_format f  )  [inline]

This method sets the output format of the sparse vector.

Definition at line 647 of file linalg.h.


Friends And Related Function Documentation

template<class _Tp>
template<typename _Tq >
std::ostream& std::operator<< ( std::ostream &  s,
const sparse_vector< _Tq > &  A 
) [friend]


Member Data Documentation

template<class _Tp>
linalg_output_format linalg::sparse_vector< _Tp >::output_format [protected]

This variable describes the output format for matrix output. Its possible values are linalg_output_sparse and linalg_output_full.

Definition at line 631 of file linalg.h.


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

Generated on Tue Feb 9 14:50:07 2010 for COCONUT API by  doxygen 1.5.8