TNT::Sparse_Vector< T > Class Template Reference

#include <tnt_sparse_vector.h>

Collaboration diagram for TNT::Sparse_Vector< T >:
[legend]

List of all members.

Public Types

typedef std::vector
< Sparse_Vector_Element< T,
Subscript > >::const_iterator 
const_iterator

Public Member Functions

const_iterator begin () const
const_iterator end () const
const T & value (Subscript i) const
Subscript index (Subscript i) const
dot_product (const Vector< T > &x) const
 Sparse_Vector ()
 Sparse_Vector (Subscript N)
 Sparse_Vector (Subscript N, Subscript nz, const T *Val, const Subscript *I)
void insert (const T &val, Subscript i)
void insert (Subscript nz, const T *Val, const Subscript *I)
void insert_base_one (const T &val, Subscript i)
void insert_base_one (Subscript nz, const T *Val, const Subscript *I)
int dim () const
int num_nonzeros () const
double norm () const
std::ostream & print (std::ostream &s) const
std::ostream & print_base_one (std::ostream &s) const

Private Attributes

std::vector
< Sparse_Vector_Element< T,
Subscript > > 
s_
int dim_
int num_nonzeros_


Detailed Description

template<class T>
class TNT::Sparse_Vector< T >

Sparse Vector.

Index values begin at 0. Thus S[3] = 6.5 means that the fourth, not the third element, is set to 6.5.

S.value(0) is the first nonzero values in S, and S.index(0) is the index (0-based) of the first in S.

Definition at line 76 of file tnt_sparse_vector.h.


Member Typedef Documentation

template<class T>
typedef std::vector< Sparse_Vector_Element<T, Subscript> >::const_iterator TNT::Sparse_Vector< T >::const_iterator

Definition at line 95 of file tnt_sparse_vector.h.


Constructor & Destructor Documentation

template<class T>
TNT::Sparse_Vector< T >::Sparse_Vector (  )  [inline]

Definition at line 117 of file tnt_sparse_vector.h.

template<class T>
TNT::Sparse_Vector< T >::Sparse_Vector ( Subscript  N  )  [inline]

Definition at line 118 of file tnt_sparse_vector.h.

template<class T>
TNT::Sparse_Vector< T >::Sparse_Vector ( Subscript  N,
Subscript  nz,
const T *  Val,
const Subscript I 
) [inline]

Definition at line 122 of file tnt_sparse_vector.h.


Member Function Documentation

template<class T>
const_iterator TNT::Sparse_Vector< T >::begin (  )  const [inline]

Definition at line 98 of file tnt_sparse_vector.h.

template<class T>
int TNT::Sparse_Vector< T >::dim (  )  const [inline]

Definition at line 163 of file tnt_sparse_vector.h.

template<class T>
T TNT::Sparse_Vector< T >::dot_product ( const Vector< T > &  x  )  const [inline]

Definition at line 104 of file tnt_sparse_vector.h.

template<class T>
const_iterator TNT::Sparse_Vector< T >::end (  )  const [inline]

Definition at line 99 of file tnt_sparse_vector.h.

template<class T>
Subscript TNT::Sparse_Vector< T >::index ( Subscript  i  )  const [inline]

Definition at line 102 of file tnt_sparse_vector.h.

template<class T>
void TNT::Sparse_Vector< T >::insert ( Subscript  nz,
const T *  Val,
const Subscript I 
) [inline]

Definition at line 138 of file tnt_sparse_vector.h.

template<class T>
void TNT::Sparse_Vector< T >::insert ( const T &  val,
Subscript  i 
) [inline]

Definition at line 131 of file tnt_sparse_vector.h.

template<class T>
void TNT::Sparse_Vector< T >::insert_base_one ( Subscript  nz,
const T *  Val,
const Subscript I 
) [inline]

Definition at line 153 of file tnt_sparse_vector.h.

template<class T>
void TNT::Sparse_Vector< T >::insert_base_one ( const T &  val,
Subscript  i 
) [inline]

Definition at line 148 of file tnt_sparse_vector.h.

template<class T>
double TNT::Sparse_Vector< T >::norm (  )  const [inline]

Definition at line 169 of file tnt_sparse_vector.h.

template<class T>
int TNT::Sparse_Vector< T >::num_nonzeros (  )  const [inline]

Definition at line 164 of file tnt_sparse_vector.h.

template<class T>
std::ostream& TNT::Sparse_Vector< T >::print ( std::ostream &  s  )  const [inline]

Definition at line 181 of file tnt_sparse_vector.h.

template<class T>
std::ostream& TNT::Sparse_Vector< T >::print_base_one ( std::ostream &  s  )  const [inline]

Definition at line 191 of file tnt_sparse_vector.h.

template<class T>
const T& TNT::Sparse_Vector< T >::value ( Subscript  i  )  const [inline]

Definition at line 101 of file tnt_sparse_vector.h.


Member Data Documentation

template<class T>
int TNT::Sparse_Vector< T >::dim_ [private]

Definition at line 86 of file tnt_sparse_vector.h.

template<class T>
int TNT::Sparse_Vector< T >::num_nonzeros_ [private]

Definition at line 87 of file tnt_sparse_vector.h.

template<class T>
std::vector< Sparse_Vector_Element<T, Subscript> > TNT::Sparse_Vector< T >::s_ [private]

Definition at line 84 of file tnt_sparse_vector.h.


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

Generated on Fri Feb 6 13:30:19 2009 for CorAL by  doxygen 1.5.8