IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
grid_utility.h File Reference
#include <IMP/algebra/algebra_config.h>
#include "GridD.h"
#include "internal/grid_interpolation.h"
#include "grid_indexes.h"
#include "internal/grid_3d_impl.h"
Include dependency graph for grid_utility.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  IMP
 Base functionality and abstract base classes for representation, scoring and sampling.
namespace  IMP::algebra
 General purpose algebraic and geometric methods that are expected to be used by a wide variety of IMP modules.

Macros

#define IMP_GRID3D_FOREACH_SMALLER_EXTENDED_INDEX_RANGE( grid, center, lower_corner, upper_corner, action)
 Iterate over each voxel in a subset of the grid that are less than center.
#define IMP_GRID3D_FOREACH_VOXEL(g, action)
 Iterate over each voxel in grid and do something with each one.

Functions

template<int D, class Storage, class Value, class Embedding>
Value IMP::algebra::get_linearly_interpolated (const GridD< D, Storage, Value, Embedding > &g, const VectorD< D > &pt)
 Get the value from the grid with linear interpolation.
template<class Storage, class Embedding>
const Storage::Value IMP::algebra::get_trilinearly_interpolated (const GridD< 3, Storage, typename Storage::Value, Embedding > &g, const Vector3D &v, const typename Storage::Value &outside=0)
 Use trilinear interpolation to compute a smoothed value at v.

Detailed Description

Utility functions for working with grids.

Copyright 2007-2026 IMP Inventors. All rights reserved.

Definition in file grid_utility.h.

Macro Definition Documentation

◆ IMP_GRID3D_FOREACH_SMALLER_EXTENDED_INDEX_RANGE

#define IMP_GRID3D_FOREACH_SMALLER_EXTENDED_INDEX_RANGE ( grid,
center,
lower_corner,
upper_corner,
action )

Iterate over each voxel in a subset of the grid that are less than center.

The voxel index is unsigned int voxel_index[3]. Use this if, for example, you want to find nearby pairs of voxels once each.

See also
Grid3D

Definition at line 120 of file grid_utility.h.

◆ IMP_GRID3D_FOREACH_VOXEL

#define IMP_GRID3D_FOREACH_VOXEL ( g,
action )

Iterate over each voxel in grid and do something with each one.

The voxel index is GridIndexD<3> voxel_index and the coordinates of the center is Vector3D voxel_center and the index of the voxel is loop_voxel_index.

See also
Grid3D

Definition at line 81 of file grid_utility.h.