pub trait StrategyBuilder<Sd, Sx, D>where
    Sd: Data,
    Sd::Elem: Num + Debug,
    Sx: Data<Elem = Sd::Elem>,
    D: Dimension,
    Self: Sized,{
    type FinishedStrat: Strategy<Sd, Sx, D>;

    const MINIMUM_DATA_LENGHT: usize;

    // Required method
    fn build<Sx2>(
        self,
        x: &ArrayBase<Sx2, Ix1>,
        data: &ArrayBase<Sd, D>
    ) -> Result<Self::FinishedStrat, BuilderError>
       where Sx2: Data<Elem = Sd::Elem>;
}

Required Associated Types§

source

type FinishedStrat: Strategy<Sd, Sx, D>

Required Associated Constants§

Required Methods§

source

fn build<Sx2>( self, x: &ArrayBase<Sx2, Ix1>, data: &ArrayBase<Sd, D> ) -> Result<Self::FinishedStrat, BuilderError>where Sx2: Data<Elem = Sd::Elem>,

initialize the strategy by validating data and possibly calculating coefficients This method is called by Interp1DBuilder::build

When this method is called by Interp1DBuilder the following properties are guaranteed:

  • x is strictly monotonically rising
  • the lenght of x equals the lenght of the data Axis 0
  • the lenght is at least MINIMUM_DATA_LENGHT
  • Interpolation will happen along axis 0

Implementors§

source§

impl<Sd, Sx, D> StrategyBuilder<Sd, Sx, D> for CubicSplinewhere Sd: Data, Sd::Elem: Debug + Num + Copy + PartialOrd + Sub + SubAssign + NumCast + Add + Pow<Sd::Elem, Output = Sd::Elem> + ScalarOperand, Sx: Data<Elem = Sd::Elem>, D: Dimension + RemoveAxis,

source§

const MINIMUM_DATA_LENGHT: usize = 3usize

§

type FinishedStrat = CubicSplineStrategy<Sd, D>

source§

impl<Sd, Sx, D> StrategyBuilder<Sd, Sx, D> for Linearwhere Sd: Data, Sd::Elem: Num + PartialOrd + NumCast + Copy + Debug + Sub, Sx: Data<Elem = Sd::Elem>, D: Dimension + RemoveAxis,