Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

vbl_sparse_array_3d< T > Class Template Reference

#include <vbl_sparse_array_3d.h>

Inheritance diagram for vbl_sparse_array_3d< T >:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<class T>
class vbl_sparse_array_3d< T >

Sparse 3d array allowing space efficient access.

You can use this as s(300,700,900) = 2.

Definition at line 33 of file vbl_sparse_array_3d.h.

Public Types

typedef Map::const_iterator const_iterator
 The type of iterators into the efficient storage.
typedef vbl_triple< unsigned,
unsigned, unsigned > 
Index_type
 The type of objects used to index the sparse array.
typedef T T_type
 The type of values stored by the sparse array.
typedef Map::value_type sequence_value_type
 The type of values of the controlled sequence.

Public Member Functions

bool put (unsigned i, unsigned j, unsigned k, const T &t)
 Put a value into location (i,j).
T & operator() (unsigned i, unsigned j, unsigned k)
 Return contents of location (i,j,k).
const T & operator() (unsigned i, unsigned j, unsigned k) const
 Return contents of (i,j,k). Assertion failure if not yet filled.
bool fullp (unsigned i, unsigned j, unsigned k) const
 Return true if location (i,j,k) has been filled.
T * get_addr (unsigned i, unsigned j, unsigned k)
 Return the address of location (i,j,k). 0 if not yet filled.
vcl_ostream & print (vcl_ostream &) const
 Print the Array to a stream in "(i,j,k): value" format.
T & operator() (vbl_triple< unsigned, unsigned, unsigned >i)
 Return contents at (i).
Tconst & operator() (vbl_triple< unsigned, unsigned, unsigned >i) const
 Return contents at (i). Asserts if (i) empty.
void erase (vbl_triple< unsigned, unsigned, unsigned >)
 Erase element at location (i). Assertion failure if not yet filled.
bool fullp (vbl_triple< unsigned, unsigned, unsigned >) const
 Return true if location (i) has been filled.
bool put (vbl_triple< unsigned, unsigned, unsigned >, const T &)
 Put a value into location (i).
T * get_addr (vbl_triple< unsigned, unsigned, unsigned >)
 Return the address of location (i). 0 if not yet filled.
void clear ()
 Empty the sparse matrix.
unsigned count_nonempty () const
 Return number of locations that have been assigned a value using "put".
const_iterator begin () const
 A bidirectional iterator pointing at the first non-empty element.
const_iterator end () const
 A bidirectional iterator pointing just beyond last non-empty element.

Protected Types

typedef vcl_map< vbl_triple<
unsigned, unsigned, unsigned >,
T, vcl_less< vbl_triple<
unsigned, unsigned, unsigned > > > 
Map
 The type of the storage.

Protected Attributes

Map storage_
 This stores a compact list of the values.


Member Typedef Documentation

typedef Map::const_iterator vbl_sparse_array_base< T , vbl_triple< unsigned, unsigned, unsigned > >::const_iterator [inherited]
 

The type of iterators into the efficient storage.

Definition at line 69 of file vbl_sparse_array_base.h.

typedef vbl_triple< unsigned, unsigned, unsigned > vbl_sparse_array_base< T , vbl_triple< unsigned, unsigned, unsigned > >::Index_type [inherited]
 

The type of objects used to index the sparse array.

Definition at line 75 of file vbl_sparse_array_base.h.

typedef vcl_map<vbl_triple< unsigned, unsigned, unsigned > , T , vcl_less<vbl_triple< unsigned, unsigned, unsigned > > > vbl_sparse_array_base< T , vbl_triple< unsigned, unsigned, unsigned > >::Map [protected, inherited]
 

The type of the storage.

Definition at line 41 of file vbl_sparse_array_base.h.

typedef Map::value_type vbl_sparse_array_base< T , vbl_triple< unsigned, unsigned, unsigned > >::sequence_value_type [inherited]
 

The type of values of the controlled sequence.

The value_type is a vcl_pair<Index_type, typename T_type>

Definition at line 82 of file vbl_sparse_array_base.h.

typedef T vbl_sparse_array_base< T , vbl_triple< unsigned, unsigned, unsigned > >::T_type [inherited]
 

The type of values stored by the sparse array.

Definition at line 78 of file vbl_sparse_array_base.h.


Member Function Documentation

const_iterator vbl_sparse_array_base< T , vbl_triple< unsigned, unsigned, unsigned > >::begin  )  const [inline, inherited]
 

A bidirectional iterator pointing at the first non-empty element.

If the array is empty it points just beyond the end.

Definition at line 86 of file vbl_sparse_array_base.h.

void vbl_sparse_array_base< T , vbl_triple< unsigned, unsigned, unsigned > >::clear  )  [inherited]
 

Empty the sparse matrix.

unsigned vbl_sparse_array_base< T , vbl_triple< unsigned, unsigned, unsigned > >::count_nonempty  )  const [inline, inherited]
 

Return number of locations that have been assigned a value using "put".

Definition at line 72 of file vbl_sparse_array_base.h.

const_iterator vbl_sparse_array_base< T , vbl_triple< unsigned, unsigned, unsigned > >::end  )  const [inline, inherited]
 

A bidirectional iterator pointing just beyond last non-empty element.

Definition at line 89 of file vbl_sparse_array_base.h.

void vbl_sparse_array_base< T , vbl_triple< unsigned, unsigned, unsigned > >::erase vbl_triple< unsigned, unsigned, unsigned >    )  [inherited]
 

Erase element at location (i). Assertion failure if not yet filled.

bool vbl_sparse_array_base< T , vbl_triple< unsigned, unsigned, unsigned > >::fullp vbl_triple< unsigned, unsigned, unsigned >    )  const [inherited]
 

Return true if location (i) has been filled.

template<class T>
bool vbl_sparse_array_3d< T >::fullp unsigned  i,
unsigned  j,
unsigned  k
const [inline]
 

Return true if location (i,j,k) has been filled.

Definition at line 64 of file vbl_sparse_array_3d.h.

T * vbl_sparse_array_base< T , vbl_triple< unsigned, unsigned, unsigned > >::get_addr vbl_triple< unsigned, unsigned, unsigned >    )  [inherited]
 

Return the address of location (i). 0 if not yet filled.

template<class T>
T* vbl_sparse_array_3d< T >::get_addr unsigned  i,
unsigned  j,
unsigned  k
[inline]
 

Return the address of location (i,j,k). 0 if not yet filled.

Definition at line 72 of file vbl_sparse_array_3d.h.

T const& vbl_sparse_array_base< T , vbl_triple< unsigned, unsigned, unsigned > >::operator() vbl_triple< unsigned, unsigned, unsigned >   i  )  const [inherited]
 

Return contents at (i). Asserts if (i) empty.

T & vbl_sparse_array_base< T , vbl_triple< unsigned, unsigned, unsigned > >::operator() vbl_triple< unsigned, unsigned, unsigned >   i  )  [inline, inherited]
 

Return contents at (i).

Definition at line 48 of file vbl_sparse_array_base.h.

template<class T>
const T& vbl_sparse_array_3d< T >::operator() unsigned  i,
unsigned  j,
unsigned  k
const [inline]
 

Return contents of (i,j,k). Assertion failure if not yet filled.

Definition at line 56 of file vbl_sparse_array_3d.h.

template<class T>
T& vbl_sparse_array_3d< T >::operator() unsigned  i,
unsigned  j,
unsigned  k
[inline]
 

Return contents of location (i,j,k).

Returns an undefined value (in fact a T()) if location (i,j,k) has not been filled with a value.

Definition at line 48 of file vbl_sparse_array_3d.h.

template<class T>
vcl_ostream & vbl_sparse_array_3d< T >::print vcl_ostream &   )  const
 

Print the Array to a stream in "(i,j,k): value" format.

Definition at line 13 of file vbl_sparse_array_3d.txx.

bool vbl_sparse_array_base< T , vbl_triple< unsigned, unsigned, unsigned > >::put vbl_triple< unsigned, unsigned, unsigned >   ,
const T & 
[inherited]
 

Put a value into location (i).

template<class T>
bool vbl_sparse_array_3d< T >::put unsigned  i,
unsigned  j,
unsigned  k,
const T &  t
[inline]
 

Put a value into location (i,j).

Definition at line 38 of file vbl_sparse_array_3d.h.


Member Data Documentation

Map vbl_sparse_array_base< T , vbl_triple< unsigned, unsigned, unsigned > >::storage_ [protected, inherited]
 

This stores a compact list of the values.

Definition at line 43 of file vbl_sparse_array_base.h.


The documentation for this class was generated from the following files:
Generated on Thu Jan 10 14:39:10 2008 for core/vbl by  doxygen 1.4.4