/** * Regular-grid N-D multilinear interpolation — `scipy.interpolate.interpn` * (default `method='linear'`, `bounds_error=True`). * * Given `n` strictly-increasing coordinate arrays (`grids`) and a matching * `n`-dimensional array of sampled values, `interpn` evaluates the * multilinear interpolant at each query point: for a query point, the * bracketing grid cell is located along every axis (binary search), and the * result is the weighted average of the `2^n` cell-corner values, weighted * by the fractional position within the cell along each axis. This is exact * for functions that are affine in each coordinate (e.g. `f(x,y) = x + y`) * and reduces to ordinary linear interpolation when `n = 1`. * * @packageDocumentation */ /** A nested numeric array of arbitrary depth (matches an N-D grid's shape). */ export type NDArrayInput = number | readonly NDArrayInput[]; /** * Regular-grid multilinear interpolation, matching `scipy.interpolate.interpn`. * * @param grids - One strictly-increasing coordinate array per dimension (1 for * 1-D, 2 for bilinear, 3 for trilinear, etc.). * @param values - Sampled values on the grid, nested `grids.length` levels * deep and shaped `grids.map(g => g.length)` (e.g. for 2-D, * `values[i][j] === f(grids[0][i], grids[1][j])`); for 1-D, a flat * `number[]`. * @param query - Points to interpolate at, each with `grids.length` coordinates. * @returns The interpolated value at each query point. * @throws If a grid axis is not strictly increasing, if `values`' shape * doesn't match `grids`, or if a query point falls outside the grid's * bounding box (matches scipy's default `bounds_error=True` — no * extrapolation). * * @example * const xs = [0, 1, 2], ys = [0, 1, 2]; * const vals = xs.map((x) => ys.map((y) => x + y)); // f(x,y) = x + y * interpn([xs, ys], vals, [[0.5, 0.5]]); // [1] (exact — f is affine) */ export declare function interpn(grids: readonly (readonly number[])[], values: NDArrayInput, query: readonly (readonly number[])[]): number[]; //# sourceMappingURL=interpn.d.ts.map