Main Page   Namespace List   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

RazorBack::Sparsevec_ Class Template Reference

Sparsevec_: template for a sparse vector class. More...

#include <Sparsevec.hh>

List of all members.

Public Methods

 Sparsevec_ ()
 Ctor: inits to empty.

const T_& get_item (size_t Idx) const
 get_item(Idx): returns a const ref to the Idx-th item.

bool set_item (size_t Idx, const T_ &Val)
 set_item(Idx, Val): stores Val at the Idx-th position. More...

void clear ()
 Resets the calling object.

bool empty () const
 Returns true after a clear() operation :-).


Protected Methods

const map<size_t, T_>& data () const

Private Attributes

map<size_t, T_> Data

Static Private Attributes

const T_ NULLITEM


Detailed Description

template<class T_> class RazorBack::Sparsevec_

Sparsevec_: template for a sparse vector class.

Only item access and emptiness test is provided. The data type T_ must support the comparison operators <, == and must have a "null item" T_(0). Only non-null items are stored.

Definition at line 37 of file Sparsevec.hh.


Constructor & Destructor Documentation

template<class T_>
RazorBack::Sparsevec_<T_>::Sparsevec_<T_> ( ) [inline]
 

Ctor: inits to empty.

Definition at line 49 of file Sparsevec.hh.


Member Function Documentation

template<class T_>
const T_ & RazorBack::Sparsevec_<T_>::get_item ( size_t Idx ) const
 

get_item(Idx): returns a const ref to the Idx-th item.

template<class T_>
bool RazorBack::Sparsevec_<T_>::set_item ( size_t Idx,
const T_ & Val )
 

set_item(Idx, Val): stores Val at the Idx-th position.

Return value: true if Idx was present, false if created anew.

template<class T_>
void RazorBack::Sparsevec_<T_>::clear ( ) [inline]
 

Resets the calling object.

Definition at line 61 of file Sparsevec.hh.

template<class T_>
bool RazorBack::Sparsevec_<T_>::empty ( ) const [inline]
 

Returns true after a clear() operation :-).

Definition at line 64 of file Sparsevec.hh.

template<class T_>
const map< size_t, T_ > & RazorBack::Sparsevec_<T_>::data<size_t, T_> ( ) const [inline, protected]
 

Definition at line 68 of file Sparsevec.hh.


Member Data Documentation

template<class T_>
const T_ RazorBack::Sparsevec_<T_>::NULLITEM [static, private]
 

Definition at line 42 of file Sparsevec.hh.

template<class T_>
map<size_t, T_> RazorBack::Sparsevec_<T_>::Data [private]
 

Definition at line 43 of file Sparsevec.hh.


The documentation for this class was generated from the following file:
Generated at Wed Aug 21 09:33:41 2002 for The Razorback C++ Library: Miscellaneous by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001