Struct ndarray_interp::Interp1DBuilder
source · pub struct Interp1DBuilder<Sd, Sx, D>where
Sd: Data,
Sd::Elem: Num + Debug,
Sx: Data<Elem = Sd::Elem>,
D: Dimension,{ /* private fields */ }
Expand description
Create and configure a Interp1D Interpolator.
Default configuration
In the default configuration the interpolation strategy is [Linear{extrapolate: false}
].
The data will be interpolated along [Axis(0)
] (currently this can not be changed).
The index to Axis(0)
of the data will be used as x values.
Implementations§
source§impl<Sd, D> Interp1DBuilder<Sd, OwnedRepr<Sd::Elem>, D>where
Sd: Data,
Sd::Elem: Num + PartialOrd + NumCast + Copy + Debug,
D: Dimension,
impl<Sd, D> Interp1DBuilder<Sd, OwnedRepr<Sd::Elem>, D>where Sd: Data, Sd::Elem: Num + PartialOrd + NumCast + Copy + Debug, D: Dimension,
sourcepub fn new(data: ArrayBase<Sd, D>) -> Self
pub fn new(data: ArrayBase<Sd, D>) -> Self
Create a new Interp1DBuilder and provide the data to interpolate. When nothing else is configured Interp1DBuilder::build will create an Interpolator using Linear Interpolation without extrapolation. As x axis the index to the data will be used. On multidimensional data interpolation happens along the first axis.
source§impl<Sd, Sx, D> Interp1DBuilder<Sd, Sx, D>where
Sd: Data,
Sd::Elem: Num + PartialOrd + NumCast + Copy + Debug,
Sx: Data<Elem = Sd::Elem>,
D: Dimension,
impl<Sd, Sx, D> Interp1DBuilder<Sd, Sx, D>where Sd: Data, Sd::Elem: Num + PartialOrd + NumCast + Copy + Debug, Sx: Data<Elem = Sd::Elem>, D: Dimension,
sourcepub fn x<NewSx>(self, x: ArrayBase<NewSx, Ix1>) -> Interp1DBuilder<Sd, NewSx, D>where
NewSx: Data<Elem = Sd::Elem>,
pub fn x<NewSx>(self, x: ArrayBase<NewSx, Ix1>) -> Interp1DBuilder<Sd, NewSx, D>where NewSx: Data<Elem = Sd::Elem>,
Add an custom x axis for the data. The axis needs to have the same lenght
and store the same Type as the data. x
must be strict monotonic rising.
If the x axis is not set the index 0..data.len() - 1
is used
sourcepub fn strategy(self, strategy: Interp1DStrategy) -> Self
pub fn strategy(self, strategy: Interp1DStrategy) -> Self
Set the Interp1DStrategy. By default Linear with Linear{extrapolate: false}
is used.