numra-interp 0.1.0

Interpolation for Numra: linear, cubic spline (natural/clamped/not-a-knot), PCHIP, Akima, barycentric Lagrange.
Documentation

numra-interp

Interpolation for the Numra workspace — linear, cubic spline, PCHIP, Akima, and barycentric Lagrange under a common Interpolant trait.

Crates.io docs.rs

1D interpolation methods chosen for the property they preserve: PCHIP for monotonicity, Akima for robustness to outliers, cubic spline for smoothness, barycentric Lagrange for stable polynomial interpolation over Chebyshev nodes.

Example

use numra_interp::{interp1d, Interp1dMethod, Interpolant};

let x = vec![0.0, 1.0, 2.0, 3.0];
let y = vec![1.0, 0.5, 0.25, 0.125];

// PCHIP preserves monotonic data — the interpolant won't overshoot
let pchip = interp1d(&x, &y, Interp1dMethod::Pchip).unwrap();
let mid = pchip.interpolate(1.5);

assert!(mid < 0.5 && mid > 0.25);

What's in this crate

  • Linear — piecewise linear
  • CubicSpline — natural, clamped, and not-a-knot boundary variants
  • Pchip — piecewise cubic Hermite (monotonicity-preserving)
  • Akima — piecewise cubic, tolerant of outliers
  • BarycentricLagrange — stable polynomial interpolation
  • Interpolant traitinterpolate, interpolate_vec, optional derivative and integrate
  • interp1d — convenience constructor by Interp1dMethod

Composes with

  • numra-ode — resampling ODE trajectories onto arbitrary points
  • numra-sde — resampling sample paths onto common grids
  • numra-integrate — quadrature against an interpolant
  • numra-fit — comparing parametric fits against non-parametric interpolants

See interop workflows for the verified ODE → cubic spline → quadrature workflow.

Install

[dependencies]
numra-interp = "0.1"

Or via the umbrella crate:

[dependencies]
numra = "0.1"

Documentation

License

Numra Academic & Research License (Non-Commercial). Academic and research use is free; commercial use requires a separate license — contact contact@spectralautomata.com. See LICENSE.