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§
Sourcetype Interpolation2d: Interpolation2d<T> + Send + Sync
type Interpolation2d: Interpolation2d<T> + Send + Sync
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::Interpolation2d, InterpolationError>
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)?;