LOOS  v2.3.2
loos::Math::SparseArray< T > Class Template Reference

Storage policy for a sparse matrix (see important note in the detailed documentation). More...

#include <MatrixStorage.hpp>

Public Types

typedef boost::unordered_map< ulong, T >::const_iterator const_iterator
 
typedef boost::unordered_map< ulong, T >::iterator iterator
 

Public Member Functions

 SparseArray (const ulong n)
 
T & operator[] (const ulong i)
 
const T & operator[] (const ulong i) const
 
ulong actualSize (void) const
 The actual size (# of elements) set.
 
iterator begin (void)
 
iterator end (void)
 
const_iterator begin (void) const
 
const_iterator end (void) const
 
double density (void) const
 Degree of sparseness...
 

Protected Member Functions

void set (const SparseArray< T > &s)
 
void copyData (const SparseArray< T > &s)
 
void resize (const ulong n)
 
void reset (void)
 

Detailed Description

template<class T>
class loos::Math::SparseArray< T >

Storage policy for a sparse matrix (see important note in the detailed documentation).

This policy implements a sparse matrix via a hash.

There are apparently some issues using the tr1::unordered_map using gcc-4.0.1. If you're using gcc-4.0.1, LOOS will switch to using the GNU provided hash_map instead. Caveat programmer...

Definition at line 149 of file MatrixStorage.hpp.


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