IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
IMP::algebra::SparseUnboundedGridD< D, VT > Struct Template Reference

A sparse, infinite grid of values. More...

#include <IMP/algebra/standard_grids.h>

Inheritance diagram for IMP::algebra::SparseUnboundedGridD< D, VT >:

Detailed Description

template<int D, class VT>
struct IMP::algebra::SparseUnboundedGridD< D, VT >

A sparse, infinite grid of values.

In Python SparseUnboundedIntGrid3D is provided.

Definition at line 37 of file standard_grids.h.

Public Types

typedef GridD< D, SparseGridStorageD< D, VT, UnboundedGridRangeD< D > >, VT, DefaultEmbeddingD< D > > P
Public Types inherited from IMP::algebra::GridD< D, SparseGridStorageD< D, VT, UnboundedGridRangeD< D > >, VT, DefaultEmbeddingD< D > >
typedef DefaultEmbeddingD< D > Embedding
typedef SparseGridStorageD< D, VT, UnboundedGridRangeD< D > > Storage
typedef VectorD< D > Vector
typedef internal::GridIndexIterator< ExtendedGridIndexD< D >, internal::AllItHelp< ExtendedGridIndexD< D >, ExtendedGridIndexD< D > > > ExtendedIndexIterator
typedef boost::iterator_range< typename Storage::IndexIterator > Indexes
typedef boost::iterator_range< typename Storage::AllIndexIterator > AllIndexes
typedef boost::iterator_range< ExtendedIndexIterator > ExtendedIndexes
Public Types inherited from IMP::algebra::SparseGridStorageD< D, VT, Base, Map >
typedef VT Value
typedef Data::const_iterator AllConstIterator
typedef boost::transform_iterator< GetIndex, AllConstIterator > AllIndexIterator

Public Member Functions

 SparseUnboundedGridD (double side, const VectorD< D > &origin, VT def=VT())
Public Member Functions inherited from IMP::algebra::GridD< D, SparseGridStorageD< D, VT, UnboundedGridRangeD< D > >, VT, DefaultEmbeddingD< D > >
 GridD ()
 An empty, undefined grid.
 GridD (const Ints counts, const BoundingBoxD< D > &bb, VT default_value=VT())
 GridD (const Storage &storage, const Embedding &embed)
 GridD (const VectorD< D > &sides, const BoundingBoxD< D > &bb, const VT &default_value=VT())
 GridD (const VectorD< D > &sides, const VectorD< D > &origin, const VT &default_value=VT())
 GridD (double side, const BoundingBoxD< D > &bb, const VT &default_value=VT())
 GridD (double side, const VectorD< D > &origin, const VT &default_value=VT())
GridIndexD< D > add_voxel (const VectorD< D > &pt, const VT &vt)
VT & at (VectorD< D >)
const VT at (VectorD< D >) const
BoundingBoxD< D > get_bounding_box () const
ExtendedGridIndexD< D > get_extended_index (const GridIndexD< D > &index) const
 Convert an index back to an extended index.
VT & operator[] (VectorD< D >)
const VT operator[] (VectorD< D >) const
void set_bounding_box (const BoundingBoxD< D > &bb3)
 Change the bounding box but not the grid or contents.
void show (std::ostream &out=std::cout) const
GridIndexD< D > get_nearest_index (const VectorD< D > &pt) const
ExtendedGridIndexD< D > get_nearest_extended_index (const VectorD< D > &pt) const
VoxelIterator voxels_begin (const BoundingBoxD< D > &bb)
VoxelIterator voxels_end (const BoundingBoxD< D > &bb)
VoxelConstIterator voxels_begin (const BoundingBoxD< D > &bb) const
VoxelConstIterator voxels_end (const BoundingBoxD< D > &bb) const
Storage::IndexIterator indexes_begin (const BoundingBoxD< D > &bb) const
Storage::IndexIterator indexes_end (const BoundingBoxD< D > &) const
ExtendedIndexIterator extended_indexes_begin (const BoundingBoxD< D > &bb) const
ExtendedIndexIterator extended_indexes_end (const BoundingBoxD< D > &) const
Indexes get_indexes (const BoundingBoxD< D > &bb) const
AllIndexes get_all_indexes () const
ExtendedIndexes get_extended_indexes (const BoundingBoxD< D > &bb) const
Functor apply (const Functor &f) const
Public Member Functions inherited from IMP::algebra::SparseGridStorageD< D, VT, Base, Map >
 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.
unsigned int get_number_of_voxels () const
void remove_voxel (const GridIndexD< D > &gi)
void show (std::ostream &out=std::cout) const
AllConstIterator all_begin () const
AllConstIterator all_end () const
AllIndexIterator all_indexes_begin () const
AllIndexIterator all_indexes_end () const
const VT at (GridIndexD< D >) const
VT & at (GridIndexD< D >)
const VT operator[] (GridIndexD< D >) const
VT & operator[] (GridIndexD< D >)
IndexIterator indexes_begin (const ExtendedGridIndexD< D > &lb, const ExtendedGridIndexD< D > &ub) const
IndexIterator indexes_end (const ExtendedGridIndexD< D > &, const ExtendedGridIndexD< D > &) const
Vector< GridIndexD< D > > get_indexes (const ExtendedGridIndexD< D > &lb, const ExtendedGridIndexD< D > &ub) const
Public Member Functions inherited from IMP::algebra::DefaultEmbeddingD< D >
 DefaultEmbeddingD (const VectorD< D > &origin, const VectorD< D > &cell)
unsigned int get_dimension () const
ExtendedGridIndexD< D > get_extended_index (const VectorD< D > &o) const
 Return the index that would contain the voxel if the grid extended there.
GridIndexD< D > get_index (const VectorD< D > &o) const
const VectorD< D > get_origin () const
const VectorD< D > & get_unit_cell () const
 Return the unit cell, relative to the origin.
void set_origin (const VectorD< D > &o)
void set_unit_cell (const VectorD< D > &o)
void show (std::ostream &out=std::cout) const
VectorD< D > get_center (const ExtendedGridIndexD< D > &ei) const
VectorD< D > get_center (const GridIndexD< D > &ei) const
BoundingBoxD< D > get_bounding_box (const ExtendedGridIndexD< D > &ei) const
BoundingBoxD< D > get_bounding_box (const GridIndexD< D > &ei) const

Member Typedef Documentation

◆ P

template<int D, class VT>
typedef GridD<D, SparseGridStorageD<D, VT, UnboundedGridRangeD<D> >, VT, DefaultEmbeddingD<D> > IMP::algebra::SparseUnboundedGridD< D, VT >::P

Definition at line 41 of file standard_grids.h.

Constructor & Destructor Documentation

◆ SparseUnboundedGridD() [1/2]

template<int D, class VT>
IMP::algebra::SparseUnboundedGridD< D, VT >::SparseUnboundedGridD ( double side,
const VectorD< D > & origin,
VT def = VT() )

Definition at line 42 of file standard_grids.h.

◆ SparseUnboundedGridD() [2/2]

template<int D, class VT>
IMP::algebra::SparseUnboundedGridD< D, VT >::SparseUnboundedGridD ( )

Definition at line 44 of file standard_grids.h.


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