Struct Interp1DBuilder

Source
pub struct Interp1DBuilder<Sd, Sx, D, Strat>
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, Linear>
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, Strat> Interp1DBuilder<Sd, Sx, D, Strat>
where Sd: Data, Sd::Elem: Num + PartialOrd + NumCast + Copy + Debug + Send, Sx: Data<Elem = Sd::Elem>, D: Dimension + RemoveAxis, Strat: Interp1DStrategyBuilder<Sd, Sx, D>,

Source

pub fn x<NewSx>( self, x: ArrayBase<NewSx, Ix1>, ) -> Interp1DBuilder<Sd, NewSx, D, Strat>
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<NewStrat>( self, strategy: NewStrat, ) -> Interp1DBuilder<Sd, Sx, D, NewStrat>
where NewStrat: Interp1DStrategyBuilder<Sd, Sx, D>,

Set the interpolation strategy by providing a Interp1DStrategyBuilder. By default Linear with Linear{extrapolate: false} is used.

Source

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

Validate input data and create the configured Interp1D

Trait Implementations§

Source§

impl<Sd, Sx, D, Strat: Debug> Debug for Interp1DBuilder<Sd, Sx, D, Strat>
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, Strat> Freeze for Interp1DBuilder<Sd, Sx, D, Strat>
where <Sd as RawData>::Elem: Sized, Strat: Freeze, Sx: Freeze, Sd: Freeze, D: Freeze,

§

impl<Sd, Sx, D, Strat> RefUnwindSafe for Interp1DBuilder<Sd, Sx, D, Strat>

§

impl<Sd, Sx, D, Strat> Send for Interp1DBuilder<Sd, Sx, D, Strat>
where <Sd as RawData>::Elem: Sized, Strat: Send, Sx: Send, Sd: Send,

§

impl<Sd, Sx, D, Strat> Sync for Interp1DBuilder<Sd, Sx, D, Strat>
where <Sd as RawData>::Elem: Sized, Strat: Sync, Sx: Sync, Sd: Sync,

§

impl<Sd, Sx, D, Strat> Unpin for Interp1DBuilder<Sd, Sx, D, Strat>
where <Sd as RawData>::Elem: Sized, Strat: Unpin, Sx: Unpin, Sd: Unpin, D: Unpin,

§

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

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.