Crate ninterp

Source
Expand description

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.

Modules§

error
Custom error types
prelude

Enums§

Extrapolate
Extrapolation strategy
Interpolator
An interpolator, with different functionality depending on variant.
Strategy
Interpolation strategy

Traits§

InterpMethods
Methods applicable to all interpolators
LeftNearest
Left-nearest (previous value) interpolation: https://en.wikipedia.org/wiki/Nearest-neighbor_interpolation
Linear
Linear interpolation: https://en.wikipedia.org/wiki/Linear_interpolation
Nearest
Nearest value (left or right, whichever nearest) interpolation: https://en.wikipedia.org/wiki/Nearest-neighbor_interpolation
RightNearest
Right-nearest (next value) interpolation: https://en.wikipedia.org/wiki/Nearest-neighbor_interpolation