Skip to main content

Interpolant

Trait Interpolant 

Source
pub trait Interpolant<S: Scalar> {
    // Required method
    fn interpolate(&self, x: S) -> S;

    // Provided methods
    fn interpolate_vec(&self, xs: &[S]) -> Vec<S> { ... }
    fn derivative(&self, x: S) -> Option<S> { ... }
    fn integrate(&self, a: S, b: S) -> Option<S> { ... }
}
Expand description

Trait for 1D interpolants.

Required Methods§

Source

fn interpolate(&self, x: S) -> S

Evaluate the interpolant at x. Extrapolates using the first/last segment if x is outside the data range.

Provided Methods§

Source

fn interpolate_vec(&self, xs: &[S]) -> Vec<S>

Evaluate at multiple points.

Source

fn derivative(&self, x: S) -> Option<S>

First derivative at x, if available.

Source

fn integrate(&self, a: S, b: S) -> Option<S>

Definite integral from a to b, if available.

Implementors§