Clipper
Static Public Member Functions
clipper::Interp_nearest Class Reference

Wrapper class for zeroth-order (nearest neighbour) interpolation fns. More...

#include <map_interp.h>

List of all members.

Static Public Member Functions

template<class M >
static bool can_interp (const M &map, const Coord_map &pos)
 Test if we can interpolate in map M at coord.
template<class T , class M >
static void interp (const M &map, const Coord_map &pos, T &val)
 Interpolate map M using type T at coord.
static int order ()
 Order of interpolant.

Detailed Description

Wrapper class for zeroth-order (nearest neighbour) interpolation fns.

These can be used through the built-in methods in Xmap/NXmap, or passed to methods to allow a choice of interpolation methods, or directly by providing the map as an argument. For example:

    NXmap<float> nxmap;
    Coord_map c;
    ...
    x1 = Interp_nearest<float>::interp( nxmap, c );
    x2 = nxmap.interp<Interp_nearest>( c );

Member Function Documentation

template<class M >
bool clipper::Interp_nearest::can_interp ( const M &  map,
const Coord_map pos 
) [static]

Test if we can interpolate in map M at coord.

The map is queried to see if interpolation is possible at the given coord. For a crystallographic map, this is always true. For a non-crystallographic map, this depends if the point and enough neighbours are in the grid.

Parameters:
mapThe map on which to perform the calculation.
posThe map coord at which the density is to be calcuated.

References clipper::Coord_map::coord_grid().

template<class T , class M >
void clipper::Interp_nearest::interp ( const M &  map,
const Coord_map pos,
T &  val 
) [static]

Interpolate map M using type T at coord.

The value of the map at the supplied map coordinate is calculated by zeroth order (nearest neighbour) interpolation based on 1 point.

Parameters:
mapThe map on which to perform the calculation.
posThe map coord at which the density is to be calcuated.
Returns:
The value of the density at that point.

References clipper::Coord_map::coord_grid().


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