#include <tnt_sparse_vector.h>
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 |
T | 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_ |
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.
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.
TNT::Sparse_Vector< T >::Sparse_Vector | ( | ) | [inline] |
Definition at line 117 of file tnt_sparse_vector.h.
TNT::Sparse_Vector< T >::Sparse_Vector | ( | Subscript | N | ) | [inline] |
Definition at line 118 of file tnt_sparse_vector.h.
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.
const_iterator TNT::Sparse_Vector< T >::begin | ( | ) | const [inline] |
Definition at line 98 of file tnt_sparse_vector.h.
int TNT::Sparse_Vector< T >::dim | ( | ) | const [inline] |
Definition at line 163 of file tnt_sparse_vector.h.
T TNT::Sparse_Vector< T >::dot_product | ( | const Vector< T > & | x | ) | const [inline] |
Definition at line 104 of file tnt_sparse_vector.h.
const_iterator TNT::Sparse_Vector< T >::end | ( | ) | const [inline] |
Definition at line 99 of file tnt_sparse_vector.h.
Subscript TNT::Sparse_Vector< T >::index | ( | Subscript | i | ) | const [inline] |
Definition at line 102 of file tnt_sparse_vector.h.
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.
void TNT::Sparse_Vector< T >::insert | ( | const T & | val, | |
Subscript | i | |||
) | [inline] |
Definition at line 131 of file tnt_sparse_vector.h.
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.
void TNT::Sparse_Vector< T >::insert_base_one | ( | const T & | val, | |
Subscript | i | |||
) | [inline] |
Definition at line 148 of file tnt_sparse_vector.h.
double TNT::Sparse_Vector< T >::norm | ( | ) | const [inline] |
Definition at line 169 of file tnt_sparse_vector.h.
int TNT::Sparse_Vector< T >::num_nonzeros | ( | ) | const [inline] |
Definition at line 164 of file tnt_sparse_vector.h.
std::ostream& TNT::Sparse_Vector< T >::print | ( | std::ostream & | s | ) | const [inline] |
Definition at line 181 of file tnt_sparse_vector.h.
std::ostream& TNT::Sparse_Vector< T >::print_base_one | ( | std::ostream & | s | ) | const [inline] |
Definition at line 191 of file tnt_sparse_vector.h.
const T& TNT::Sparse_Vector< T >::value | ( | Subscript | i | ) | const [inline] |
Definition at line 101 of file tnt_sparse_vector.h.
int TNT::Sparse_Vector< T >::dim_ [private] |
Definition at line 86 of file tnt_sparse_vector.h.
int TNT::Sparse_Vector< T >::num_nonzeros_ [private] |
Definition at line 87 of file tnt_sparse_vector.h.
std::vector< Sparse_Vector_Element<T, Subscript> > TNT::Sparse_Vector< T >::s_ [private] |
Definition at line 84 of file tnt_sparse_vector.h.