pub trait Extrapolate {
// Required methods
fn domain(&self) -> (f64, f64);
fn value_at(&self, x: f64) -> f64;
// Provided method
fn extrapolate(&self, x: f64, mode: &ExtrapolationBehavior) -> f64 { ... }
}Expand description
Composable extrapolation for 1-D interpolators.
Implementors must provide:
domain— the closed interval[x_min, x_max].value_at— interior evaluation (assumed valid only within the domain; behaviour outside is undefined).
The provided default extrapolate method
dispatches to the five modes in ExtrapolationBehavior.
Required Methods§
Provided Methods§
Sourcefn extrapolate(&self, x: f64, mode: &ExtrapolationBehavior) -> f64
fn extrapolate(&self, x: f64, mode: &ExtrapolationBehavior) -> f64
Evaluate at x, applying mode for out-of-domain queries.
If x is inside the domain the function falls through to value_at.