My Project
Loading...
Searching...
No Matches
TNT::Sparse_Vector< T > Class Template Reference

#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
 
dot_product (const Vector< T > &x) const
 
 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
 

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.


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