#interpolation #multi-dimensional #numerical #approximation #multilinear

ninterp

Numerical interpolation in N-dimensions over a regular, sorted, nonrepeating grid

1 unstable release

0.1.0 Nov 27, 2024

#959 in Math

Download history 133/week @ 2024-11-26 91/week @ 2024-12-03 80/week @ 2024-12-10 75/week @ 2024-12-17 61/week @ 2024-12-24 363/week @ 2024-12-31 155/week @ 2025-01-07

662 downloads per month
Used in 3 crates (via routee-compass-powertrain)

BSD-3-Clause

72KB
1.5K SLoC

ninterp

The ninterp crate provides multivariate interpolation over a regular, sorted, nonrepeating grid of any dimensionality. A variety of interpolation strategies are implemented, however more are likely to be added. Extrapolation beyond the range of the supplied coordinates is supported for 1-D linear interpolators, using the slope of the nearby points.

There are hard-coded interpolators for lower dimensionalities (up to N = 3) for better runtime performance.

All interpolation is handled through instances of the Interpolator enum, with the selected tuple variant containing relevant data. Interpolation is executed by calling Interpolator::interpolate.

Feature Flags

  • serde: support for serde

Getting Started

See the Interpolator enum documentation for examples and notes on usage.


lib.rs:

The ninterp crate provides multivariate interpolation over a regular, sorted, nonrepeating grid of any dimensionality. A variety of interpolation strategies are implemented, however more are likely to be added. Extrapolation beyond the range of the supplied coordinates is supported for 1-D linear interpolators, using the slope of the nearby points.

There are hard-coded interpolators for lower dimensionalities (up to N = 3) for better runtime performance.

All interpolation is handled through instances of the Interpolator enum, with the selected tuple variant containing relevant data. Interpolation is executed by calling Interpolator::interpolate.

Feature Flags

  • serde: support for serde

Getting Started

See the Interpolator enum documentation for examples and notes on usage.

Dependencies

~2–2.8MB
~55K SLoC