pub trait InterpType<T> {
type Interpolation: Interpolation<T> + Send + Sync;
// Required methods
fn build(
&self,
xa: &[T],
ya: &[T],
) -> Result<Self::Interpolation, InterpolationError>;
fn name(&self) -> &str;
fn min_size(&self) -> usize;
}
Expand description
Representation of an Interpolation Type.
Required Associated Types§
Sourcetype Interpolation: Interpolation<T> + Send + Sync
type Interpolation: Interpolation<T> + Send + Sync
The returned Interpolator, containing the calculated coefficients and providing the evaluation methods.
Required Methods§
Sourcefn build(
&self,
xa: &[T],
ya: &[T],
) -> Result<Self::Interpolation, InterpolationError>
fn build( &self, xa: &[T], ya: &[T], ) -> Result<Self::Interpolation, InterpolationError>
Creates an Interpolator from the data arrays xa
and ya
.
§Example
let xa = [0.0, 1.0, 2.0];
let ya = [0.0, 2.0, 4.0];
let interp = Cubic.build(&xa, &ya)?;