ndpolator 1.3.0
fast, n-dimensional linear interpolation and extrapolation on sparse grids
Loading...
Searching...
No Matches
Convenience Functions

Helper functions that help inspect and debug ndpolator structures. More...

Functions

void ndp_table_print (ndp_table *table)
 Prints ndp_table information.
void ndp_hypercube_print (ndp_hypercube *hc, const char *prefix)
 Prints ndp_hypercube information for debugging.
int ndp_idx2pos (ndp_axes *axes, int vdim, int *index, int *pos)
 Converts array of indices to integer position in flattened array.
int ndp_pos2idx (ndp_axes *axes, int vdim, int pos, int *idx)
 Converts integer position to array of per-axis indices.

Detailed Description

Helper functions that help inspect and debug ndpolator structures.

These functions are used to validate and inspect ndpolator structures.

Function Documentation

◆ ndp_table_print()

void ndp_table_print ( ndp_table * table)

Prints ndp_table information.

Parameters
tablendp_table instance to print

Prints basic information about the ndp_table instance, including vertex (function value) dimension, number of axes, axis lengths, number of basic vertices, and number of undefined vertices.

◆ ndp_hypercube_print()

void ndp_hypercube_print ( ndp_hypercube * hc,
const char * prefix )

Prints ndp_hypercube information for debugging.

Parameters
hcndp_hypercube instance to print
prefixString to prefix each printed line with (can be NULL)

Prints basic information about the ndp_hypercube instance, including dimension, vertex dimension (function value length), whether the hypercube is fully defined, and all vertex function values.

◆ ndp_idx2pos()

int ndp_idx2pos ( ndp_axes * axes,
int vdim,
int * index,
int * pos )
extern

Converts array of indices to integer position in flattened array.

Parameters
axesndp_axes structure with all axis definitions
vdimVertex dimension (function value length)
indexArray of per-axis indices
[out]posInteger position in the flattened array
Returns
ndp_status code

For efficiency, all ndpolator arrays are flattened (1-dimensional), where axes are stacked in the usual C order (last axis runs first, i.e. last dimension is stride-1). Referring to grid elements can be done either by position in the 1-dimensional array, or per-axis indices. This function converts index representation to position.

◆ ndp_pos2idx()

int ndp_pos2idx ( ndp_axes * axes,
int vdim,
int pos,
int * idx )
extern

Converts integer position to array of per-axis indices.

Parameters
axesndp_axes structure with all axis definitions
vdimFunction value length (number of values per grid point)
posInteger position in flattened array
[out]idxArray of per-axis indices (must be pre-allocated)
Returns
ndp_status code

For efficiency, all ndpolator arrays are flattened (1-dimensional), where axes are stacked in the usual C order (last axis runs first, i.e. last dimension is stride-1). Referring to grid elements can be done either by position in the 1-dimensional array, or per-axis indices. This function converts position representation to index.