pub trait InterpType<T>where
T: Num,{
type Interpolator: Interpolation<T>;
const MIN_SIZE: usize;
const NAME: &str;
// Required method
fn build(
&self,
xa: &[T],
ya: &[T],
) -> Result<Self::Interpolator, InterpolationError>;
// Provided methods
fn name(&self) -> String { ... }
fn min_size(&self) -> usize { ... }
}
Expand description
Representation of an Interpolation Type.
Required Associated Constants§
Required Associated Types§
Sourcetype Interpolator: Interpolation<T>
type Interpolator: Interpolation<T>
The returned Interpolator, containing the calculated coefficients and providing the evaluation methods.
Required Methods§
Sourcefn build(
&self,
xa: &[T],
ya: &[T],
) -> Result<Self::Interpolator, InterpolationError>
fn build( &self, xa: &[T], ya: &[T], ) -> Result<Self::Interpolator, InterpolationError>
Creates an Interpolator from the data arrays xa
and ya
.
§Example
use rsl_interpolation::Cubic;
let xa = [0.0, 1.0, 2.0];
let ya = [0.0, 2.0, 4.0];
let interp = Cubic.build(&xa, &ya)?;
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.