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§
Required Associated Types§
Sourcetype Interpolator2d: Interpolation2d<T>
type Interpolator2d: Interpolation2d<T>
The returned 2D Interpolator, containing the calculated coefficients and providing the evaluation methods.
Required Methods§
Sourcefn build(
&self,
xa: &[T],
ya: &[T],
za: &[T],
) -> Result<Self::Interpolator2d, InterpolationError>
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§
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.