ndpolator 1.3.0
fast, n-dimensional linear interpolation and extrapolation on sparse grids
Loading...
Searching...
No Matches
Python Interface Constructors

Constructors that create ndpolator structures from Python objects. More...

Functions

ndp_axesndp_axes_new_from_python (PyObject *py_axes, int nbasic)
 Constructor for ndp_axes from Python objects.
ndp_tablendp_table_new_from_python (PyObject *py_axes, int nbasic, PyArrayObject *py_grid)
 Constructor for ndp_table from Python objects.

Detailed Description

Constructors that create ndpolator structures from Python objects.

These functions are part of the Python C extension and handle conversion of Python objects (NumPy arrays, tuples, etc.) into native C data structures used by the core ndpolator library.

Function Documentation

◆ ndp_axes_new_from_python()

ndp_axes * ndp_axes_new_from_python ( PyObject * py_axes,
int nbasic )

Constructor for ndp_axes from Python objects.

Parameters
py_axesTuple of ndarrays, one for each axis
nbasicNumber of basic axes

Initializes a new ndp_axes instance by translating python data into C and then calling ndp_axes_new_from_data(). The py_axes argument must be a tuple of ndarrays, one for each axis. Each ndarray must be one-dimensional and of type NPY_DOUBLE. The nbasic argument specifies how many of the axes are basic axes; the rest are associated axes. If nbasic is set to 0, all axes are considered basic axes.

Returns
Initialized ndp_axes instance

◆ ndp_table_new_from_python()

ndp_table * ndp_table_new_from_python ( PyObject * py_axes,
int nbasic,
PyArrayObject * py_grid )

Constructor for ndp_table from Python objects.

Parameters
py_axesPython object containing axis data
nbasicNumber of basic axes
py_gridPython numpy array containing grid data

Initializes a new ndp_table instance by translating python data into C and then calling ndp_table_new_from_data(). The passed py_axes parameter must be a tuple of numpy arrays, one for each axis; the passed nbasic must be an integer that provides the number of basic axes (<= len(py_axes)), and the passed py_grid parameter must be a numpy array of the shape (n1, n2, ..., nk, ..., nN, vdim), where nk is the length of the k-th axis.

Returns
Initialized ndp_table instance