NAME

cxLookupCreate - creates a lookup table for subsequent interpolation of lattice values

C SPECIFICATION

#include <cx/Lookup.h>

cxLookup *cxLookupCreate(cxLattice *lattice, cxLookupType interp)

FORTRAN SPECIFICATION

integer function cxLookupCreate(lattice, interp)
integer lattice, interp

PARAMETERS

lattice
Input lattice structure to be preprocessed into the lookup table.
interp
Input mode of interpolation to be used in accessing table.

FUNCTION RETURN VALUE

The return value for this function is a pointer to the lookup table structure.

DESCRIPTION

Creates and returns a lookup table to support queries of the interpolated data values at coordinate locations within a lattice.

The lookup table is built to perform interpolation according to the method specified by the variable interp. Setting interp = cx_lookup_nearest specifies nearest neighbor interpolation, while setting interp = cx_lookup_linear specifies linear interpolation.

The returned lookup table contains a reference to the lattice and to other auxiliary information that speeds up lookup operations. The shared memory reference count of the lattice is incremented by one to indicate its use in the lookup table structure (defined in the file cx/Lookup.h).

For curvilinear lattices with nCoordVar > nDim (scattered data) NAG routines are used for interpolation within the bounding box, while an error exit is returned outside the bounding box. Strictly speaking this is a combination of interpolation (for points inside the lattice domain) and extrapolation (for points outside the lattice domain but inside the bounding box). The nearest neighbor method is faster, but less accurate than, the linear method.

For curvilinear lattices with nDim = nCoordVar (structured meshes), as well as all uniform and perimeter lattices a different interpolation method is employed. Curvilinear lattices are preprocessed using a k-D tree for faster point location in the lattice. In this case, performing lookups on a uniform or perimeter lattice is substantially faster than on a curvilinear lattice. There is little difference in execution speed between nearest neighbor and linear interpolation.

Lookup tables are used to preprocess colormap information for later color lookup, for example in the Contour module. They are also used in the Interpolate and PickLat modules for data interpolation, and in modules that calculate particle trajectories, such as NAGAdvectSimple and NAGAdvectAnimate.

SEE ALSO

cxLookupInterp(3E), cxLookupIndex(3E), cxLookupDestroy(3E), cxDataRefInc(3E), Contour(1E), Interpolate(1E).
Last modified: May 27 12:06 1999
[ Documentation Home ]
© The Numerical Algorithms Group Ltd, Oxford UK. 1999