Interp2dType

Trait Interp2dType 

Source
pub trait Interp2dType<T> {
    type Interpolation2d: Interpolation2d<T> + Send + Sync;

    // Required methods
    fn build(
        &self,
        xa: &[T],
        ya: &[T],
        za: &[T],
    ) -> Result<Self::Interpolation2d, InterpolationError>;
    fn name(&self) -> &str;
    fn min_size(&self) -> usize;
}
Expand description

Representation of a 2D Interpolation Type.

§Important

The za array must be defined in column-major (Fortran) style. This is done to comply with GSL’s interface.

For 2d interpolation, 2 separate Accelerators are required for each of the grid variables.

Required Associated Types§

Source

type Interpolation2d: Interpolation2d<T> + Send + Sync

The returned 2D Interpolator, containing the calculated coefficients and providing the evaluation methods.

Required Methods§

Source

fn build( &self, xa: &[T], ya: &[T], za: &[T], ) -> Result<Self::Interpolation2d, InterpolationError>

Creates a 2D Interpolator from the data arrays xa, ya and za.

§Example
let xa = [0.0, 1.0, 2.0, 3.0];
let ya = [0.0, 2.0, 4.0, 6.0];
// z = x + y
let za = [
    0.0, 1.0, 2.0, 3.0,
    2.0, 3.0, 4.0, 5.0,
    4.0, 5.0, 6.0, 7.0,
    6.0, 7.0, 8.0, 9.0,
];

let interp = Bicubic.build(&xa, &ya, &za)?;
Source

fn name(&self) -> &str

Returns the name of the Interpolator.

Source

fn min_size(&self) -> usize

Returns the minimum number of points required by the Interpolator.

Implementors§