IMP  2.1.1
The Integrative Modeling Platform
IMP::algebra::SparseGridStorageD< D, VT, Base, Map > Class Template Reference

#include <IMP/algebra/grid_storages.h>

+ Inheritance diagram for IMP::algebra::SparseGridStorageD< D, VT, Base, Map >:

Public Types

typedef VT Value
 

Public Member Functions

 SparseGridStorageD (const Ints &counts, const VT &default_value)
 
GridIndexD< D > add_voxel (const ExtendedGridIndexD< D > &i, const VT &gi)
 Add a voxel to the storage, this voxel will now have a GridIndex3D.
 
template<class Functor , class Grid >
Functor apply (const Grid &g, Functor f) const
 
bool get_has_index (const ExtendedGridIndexD< D > &i) const
 Return true if the voxel has been added.
 
GridIndexD< D > get_index (const ExtendedGridIndexD< D > &i) const
 requires get_has_index(i) is true.
 
ExtendedGridIndexD< D > get_maximum_extended_index () const
 Return the index that has no higher index in each coordinate.
 
ExtendedGridIndexD< D > get_minimum_extended_index () const
 Return the index which has no lower index in each coordinate.
 
unsigned int get_number_of_voxels () const
 
void remove_voxel (const GridIndexD< D > &gi)
 
void show (std::ostream &out=std::cout) const
 

Operator []

Operator[] isn't very useful at the moment as it can only be used with a cell which has already been set. This behavior/the existence of these functions is likely to change.

const VT operator[] (GridIndexD< D >) const
 
VT & operator[] (GridIndexD< D >)
 

Iterators through set cells

Iterate through the voxels which have been set. The value type is a pair of GridIndex3D and VT.

typedef Data::const_iterator AllConstIterator
 
AllConstIterator all_begin () const
 
AllConstIterator all_end () const
 
base::Vector< GridIndexD< D > > get_all_indexes () const
 

Index Iterators

Iterate through a range of actual indexes. The value type for the iterator is an GridIndex3D.

The range is defined by a pair of indexes. It includes all indexes in the axis aligned box defined by lb as the lower corner and the second as the ub. That is, if lb is \((l_x, l_y, l_z)\) and ub is \((u_x, u_y, u_z)\), then the range includes all indexes \((i_x, i_y, i_z)\) such that \(l_x \leq i_x \leq u_x\), \(l_y \leq i_y \leq u_y\) and \(l_z \leq i_z \leq u_z\).

IndexIterator indexes_begin (const ExtendedGridIndexD< D > &lb, const ExtendedGridIndexD< D > &ub) const
 
IndexIterator indexes_end (const ExtendedGridIndexD< D > &, const ExtendedGridIndexD< D > &) const
 
base::Vector< GridIndexD< D > > get_indexes (const ExtendedGridIndexD< D > &lb, const ExtendedGridIndexD< D > &ub) const
 

Detailed Description

template<int D, class VT, class Base, class Map = typename IMP::base::map<GridIndexD<D>, VT>>
class IMP::algebra::SparseGridStorageD< D, VT, Base, Map >

Store a grid as a sparse set of voxels (only the voxels which have been added are actually stored). The get_has_index() functions allow one to tell if a voxel has been added.

Warning: SparseGridStorageD has not been stabilized and is likely to change without notice.

Base should be one of BoundedGridRangeD or UnboundedGridRangeD.

See Also
Grid3D

Definition at line 183 of file grid_storages.h.


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