IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
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:

*BoundedGridRange3D::get_number_of_voxels(1)
+ i[1]*BoundedGridRange3D::get_number_of_voxels(0)+i[0]
unsigned int get_number_of_voxels(unsigned int i) const
Return the number of voxels in a certain direction.
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
VT & at (GridIndexD< D >)
const VT at (GridIndexD< D >) const
VT * get_raw_data ()
const VT * get_raw_data () const
DenseGridStorageD & operator= (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.
unsigned int get_number_of_voxels () const
unsigned int get_number_of_voxels (unsigned int i) const
 Return the number of voxels in a certain direction.
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
GridIndexD< D > get_index (const ExtendedGridIndexD< D > &v) const
 Convert a ExtendedIndex into a real Index if possible.
bool get_has_index (const ExtendedGridIndexD< D > &v) const
 Return true if the ExtendedIndex is also a normal index value.
ExtendedGridIndexD< D > get_minimum_extended_index () const
 Return the ExtendedGridIndexD of all zeros.
ExtendedGridIndexD< D > get_maximum_extended_index () const
 Return the index of the maximal cell.

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

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)

Member Typedef Documentation

◆ AllVoxelConstIterator

template<int D, class VT>
typedef const VT* IMP::algebra::DenseGridStorageD< D, VT >::AllVoxelConstIterator

Definition at line 146 of file grid_storages.h.

◆ AllVoxelIterator

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

Definition at line 145 of file grid_storages.h.

◆ Value

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

Definition at line 98 of file grid_storages.h.

Constructor & Destructor Documentation

◆ DenseGridStorageD() [1/2]

template<int D, class VT>
IMP::algebra::DenseGridStorageD< D, VT >::DenseGridStorageD ( const DenseGridStorageD< D, VT > & o)

Definition at line 97 of file grid_storages.h.

◆ DenseGridStorageD() [2/2]

template<int D, class VT>
IMP::algebra::DenseGridStorageD< D, VT >::DenseGridStorageD ( const Ints & counts,
const VT & default_value = VT() )

Definition at line 99 of file grid_storages.h.

Member Function Documentation

◆ all_voxels_begin() [1/2]

template<int D, class VT>
AllVoxelIterator IMP::algebra::DenseGridStorageD< D, VT >::all_voxels_begin ( )

Definition at line 147 of file grid_storages.h.

◆ all_voxels_begin() [2/2]

template<int D, class VT>
AllVoxelConstIterator IMP::algebra::DenseGridStorageD< D, VT >::all_voxels_begin ( ) const

Definition at line 149 of file grid_storages.h.

◆ all_voxels_end() [1/2]

template<int D, class VT>
AllVoxelIterator IMP::algebra::DenseGridStorageD< D, VT >::all_voxels_end ( )

Definition at line 148 of file grid_storages.h.

◆ all_voxels_end() [2/2]

template<int D, class VT>
AllVoxelConstIterator IMP::algebra::DenseGridStorageD< D, VT >::all_voxels_end ( ) const

Definition at line 150 of file grid_storages.h.

◆ apply()

template<int D, class VT>
template<class Functor, class Grid>
Functor IMP::algebra::DenseGridStorageD< D, VT >::apply ( const Grid & g,
const Functor & fi ) const

Definition at line 159 of file grid_storages.h.

◆ get_all_voxels()

template<int D, class VT>
Vector< VT > IMP::algebra::DenseGridStorageD< D, VT >::get_all_voxels ( ) const

Definition at line 154 of file grid_storages.h.

◆ get_raw_data() [1/2]

template<int D, class VT>
VT * IMP::algebra::DenseGridStorageD< D, VT >::get_raw_data ( )

Definition at line 121 of file grid_storages.h.

◆ get_raw_data() [2/2]

template<int D, class VT>
const VT * IMP::algebra::DenseGridStorageD< D, VT >::get_raw_data ( ) const

Definition at line 120 of file grid_storages.h.

◆ operator=()

template<int D, class VT>
DenseGridStorageD & IMP::algebra::DenseGridStorageD< D, VT >::operator= ( const DenseGridStorageD< D, VT > & o)

Definition at line 97 of file grid_storages.h.


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