NAME

cxLookupIndex - interpolate into lattice index space at one coordinate location

C SPECIFICATION

#include <cx/Lookup.h>

int cxLookupIndex(cxLookup *lut, float *loc, float *indices)

FORTRAN SPECIFICATION

integer function cxLookupIndex(lut, loc, indices)
integer lut
real loc(*)
real indices(*)

PARAMETERS

lut
Input lookup table structure.
loc
Input vector of the point location at which to look up data.
indices
Output vector of lattice indices at coordinate location loc.

FUNCTION RETURN VALUE

The return value for this function is an error code.

DESCRIPTION

cxLookupIndex accepts the floating point coordinates of a single point and returns its index space coordinates.

The index space coordinates of a lattice are the zero-based array indices of the lattice's data array. For instance, a lattice of size 10 by 20 would have x indices ranging from 0 to 9 and y indices ranging from 0 to 19. On this lattice, cxLookupIndex would return floating point fractional indices within these ranges. The index space coordinates indicate the point in the lattice whose interpolated coordinates would equal loc.

The sizes of loc and indices must be loc[nCoordVar] and indices[nDim], where nCoordVar and nDim are the number of coordinate variables and number of dimensions for the lattice referenced by the lookup table, respectively.

The action of cxLookupIndex is comparable to the first two steps of cxLookupInterp, finding the integer indices of the lattice cell that contains the point loc, and calculating the fractional indices of the coordinate point within the cell. The cell number yields the integer part of indices and the fractional cell indices yield the fractional part of indices.

This function returns zero to indicate success and one if a domain error is encountered, meaning that the sample point was outside the coordinate space of the lattice. For domains errors in uniform and perimeter lattices, the sample point is clamped to the domain. For domains errors in curvilinear lattices, the returned indicess are set to negative one.

SEE ALSO

cxLookupCreate(3E), cxLookupIndexV(3E), cxLookupInterp(3E)
Last modified: Mon Nov 18 13:50:40 GMT 1996
[ Documentation Home ]
© The Numerical Algorithms Group Ltd, Oxford UK. 1996