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,

source

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,

source

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

source

pub fn strategy(self, strategy: Interp1DStrategy) -> Self

Set the Interp1DStrategy. By default Linear with Linear{extrapolate: false} is used.

source

pub fn build(self) -> Result<Interp1D<Sd, Sx, D>, BuilderError>

Validate input data and create the configured Interp1D

Trait Implementations§

source§

impl<Sd, Sx, D> Debug for Interp1DBuilder<Sd, Sx, D>where Sd: Data + Debug, Sd::Elem: Num + Debug, Sx: Data<Elem = Sd::Elem> + Debug, D: Dimension + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Sd, Sx, D> RefUnwindSafe for Interp1DBuilder<Sd, Sx, D>where D: RefUnwindSafe, Sd: RefUnwindSafe, Sx: RefUnwindSafe, <Sd as RawData>::Elem: RefUnwindSafe,

§

impl<Sd, Sx, D> Send for Interp1DBuilder<Sd, Sx, D>where Sd: Send, Sx: Send,

§

impl<Sd, Sx, D> Sync for Interp1DBuilder<Sd, Sx, D>where Sd: Sync, Sx: Sync,

§

impl<Sd, Sx, D> Unpin for Interp1DBuilder<Sd, Sx, D>where D: Unpin, Sd: Unpin, Sx: Unpin,

§

impl<Sd, Sx, D> UnwindSafe for Interp1DBuilder<Sd, Sx, D>where D: UnwindSafe, Sd: UnwindSafe, Sx: UnwindSafe, <Sd as RawData>::Elem: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.