Interp2dType

Trait Interp2dType 

Source
pub trait Interp2dType<T>
where T: Num,
{ type Interpolator2d: Interpolation2d<T>; const MIN_SIZE: usize; const NAME: &str; // Required method fn build( &self, xa: &[T], ya: &[T], za: &[T], ) -> Result<Self::Interpolator2d, InterpolationError>; // Provided methods fn name(&self) -> String { ... } 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 seperate Accelerators are required for each of the grid variables.

Required Associated Constants§

Source

const MIN_SIZE: usize

The minimum number of points required by the Interpolator.

Source

const NAME: &str

The name of the Interpolator.

Required Associated Types§

Source

type Interpolator2d: Interpolation2d<T>

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::Interpolator2d, 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)?;

Provided Methods§

Source

fn name(&self) -> String

Returns the name of the Interpolator.

Source

fn min_size(&self) -> usize

Returns the minimum number of points required by the Interpolator.

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.

Implementors§

Source§

impl<T> Interp2dType<T> for Bicubic
where T: Num + Lapack,

Source§

const MIN_SIZE: usize = 4usize

Source§

const NAME: &str = "Bicubic"

Source§

type Interpolator2d = BicubicInterp<T>

Source§

impl<T> Interp2dType<T> for Bilinear
where T: Num,

Source§

const MIN_SIZE: usize = 2usize

Source§

const NAME: &str = "Bilinear"

Source§

type Interpolator2d = BilinearInterp<T>