IMP logo
IMP Reference Guide  2.6.1
The Integrative Modeling Platform
IMP::algebra::DenseGridStorageD< D, VT > Class Template Reference

#include <IMP/algebra/grid_storages.h>

+ Inheritance diagram for IMP::algebra::DenseGridStorageD< D, VT >:

Detailed Description

template<int D, class VT>
class IMP::algebra::DenseGridStorageD< D, VT >

Store a grid as a densely packed set of voxels. The mapping from GridIndex3D to index in the data array is:

i[2]*BoundedGridRangeD::get_number_of_voxels(0)
BoundedGridRange3D::get_number_of_voxels(1)
+ i[1]*BoundedGridRange3D::get_number_of_voxels(0)+i[0]
See Also
Grid3D

Definition at line 38 of file grid_storages.h.

Public Types

typedef VT Value
 
- Public Types inherited from IMP::algebra::BoundedGridRangeD< D >
typedef ExtendedGridIndexD< D > ExtendedIndex
 
typedef GridIndexD< D > Index
 

Public Member Functions

 DenseGridStorageD (const DenseGridStorageD &o)
 
 DenseGridStorageD (const Ints &counts, const VT &default_value=VT())
 
template<class Functor , class Grid >
Functor apply (const Grid &g, const Functor &fi) const
 
const VT at (GridIndexD< D >) const
 
VT & at (GridIndexD< D >)
 
const VT * get_raw_data () const
 
VT * get_raw_data ()
 
DenseGridStorageDoperator= (const DenseGridStorageD &o)
 
VT & operator[] (GridIndexD< D >)
 
const VT operator[] (GridIndexD< D >) const
 
void show (std::ostream &out=std::cout) const
 
- Public Member Functions inherited from IMP::algebra::BoundedGridRangeD< D >
 BoundedGridRangeD (const Ints &counts)
 
ExtendedGridIndexD< D > get_end_index () const
 Get the past-end voxel. More...
 
bool get_has_index (const ExtendedGridIndexD< D > &v) const
 Return true if the ExtendedIndex is also a normal index value. More...
 
GridIndexD< D > get_index (const ExtendedGridIndexD< D > &v) const
 Convert a ExtendedIndex into a real Index if possible. More...
 
ExtendedGridIndexD< D > get_maximum_extended_index () const
 Return the index of the maximal cell. More...
 
ExtendedGridIndexD< D > get_minimum_extended_index () const
 Return the ExtendedGridIndexD of all zeros. More...
 
unsigned int get_number_of_voxels (unsigned int i) const
 Return the number of voxels in a certain direction. More...
 
unsigned int get_number_of_voxels () const
 
void show (std::ostream &out=std::cout) const
 
AllIndexIterator all_indexes_begin () const
 
AllIndexIterator all_indexes_end () const
 
Vector< GridIndexD< D > > get_all_indexes () const
 
IndexIterator indexes_begin (const ExtendedGridIndexD< D > &lb, const ExtendedGridIndexD< D > &ub) const
 
IndexIterator indexes_end (const ExtendedGridIndexD< D > &, const ExtendedGridIndexD< D > &) const
 
ExtendedIndexIterator extended_indexes_begin (const ExtendedGridIndexD< D > &lb, const ExtendedGridIndexD< D > &ub) const
 
ExtendedIndexIterator extended_indexes_end (const ExtendedGridIndexD< D > &, const ExtendedGridIndexD< D > &) const
 
Vector< GridIndexD< D > > get_indexes (const ExtendedGridIndexD< D > &lb, const ExtendedGridIndexD< D > &ub) const
 
Vector< ExtendedGridIndexD< D > > get_extended_indexes (const ExtendedGridIndexD< D > &lb, const ExtendedGridIndexD< D > &ub) const
 

Direct indexing

One can directly access a particular voxel based on its index in the array of all voxels. This can be faster than using a GridIndexD.

const VT at (unsigned int) const
 
VT & at (unsigned int)
 
const VT operator[] (unsigned int) const
 
VT & operator[] (unsigned int)
 

All voxel iterators

The value type is VT.

typedef VT * AllVoxelIterator
 
typedef const VT * AllVoxelConstIterator
 
AllVoxelIterator all_voxels_begin ()
 
AllVoxelIterator all_voxels_end ()
 
AllVoxelConstIterator all_voxels_begin () const
 
AllVoxelConstIterator all_voxels_end () const
 
Vector< VT > get_all_voxels () const
 

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