pub struct LinearInterpolator;Expand description
Linear Interpolator.
This interpolation method does not require any additional memory.
Trait Implementations§
Source§impl BuildInterpolator for LinearInterpolator
impl BuildInterpolator for LinearInterpolator
Source§fn build(xa: &[f64], ya: &[f64]) -> Result<Self, InterpolationError>
fn build(xa: &[f64], ya: &[f64]) -> Result<Self, InterpolationError>
Constructs a Linear Interpolator.
§Example
let xa = [0.0, 1.0, 2.0];
let ya = [0.0, 2.0, 4.0];
let interp = LinearInterpolator::build(&xa, &ya)?;§Errors
InterpolationError::UnsortedDataset:xais not monotonically increasing.InterpolationError::DatasetMismatch:xaandyado not have the same length.InterpolationError::NotEnoughPoints: length ofxais less that 2.
Source§impl Clone for LinearInterpolator
impl Clone for LinearInterpolator
Source§fn clone(&self) -> LinearInterpolator
fn clone(&self) -> LinearInterpolator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LinearInterpolator
impl Debug for LinearInterpolator
Source§impl Interpolation for LinearInterpolator
impl Interpolation for LinearInterpolator
Source§fn eval_deriv2(
&self,
xa: &[f64],
_: &[f64],
x: f64,
_: &mut Accelerator,
) -> Result<f64, Domain1dError>
fn eval_deriv2( &self, xa: &[f64], _: &[f64], x: f64, _: &mut Accelerator, ) -> Result<f64, Domain1dError>
Always returns 0.
Source§fn eval(
&self,
xa: &[f64],
ya: &[f64],
x: f64,
acc: &mut Accelerator,
) -> Result<f64, Domain1dError>
fn eval( &self, xa: &[f64], ya: &[f64], x: f64, acc: &mut Accelerator, ) -> Result<f64, Domain1dError>
Returns the interpolated value
y for a given point x, using the data arrays xa and ya and
the Accelerator acc. Read moreSource§fn eval_deriv(
&self,
xa: &[f64],
ya: &[f64],
x: f64,
acc: &mut Accelerator,
) -> Result<f64, Domain1dError>
fn eval_deriv( &self, xa: &[f64], ya: &[f64], x: f64, acc: &mut Accelerator, ) -> Result<f64, Domain1dError>
Returns the derivative
dy/dx of an interpolated function for a given point x, using the
data arrays xa and ya and the Accelerator acc. Read moreSource§fn eval_integ(
&self,
xa: &[f64],
ya: &[f64],
a: f64,
b: f64,
acc: &mut Accelerator,
) -> Result<f64, Domain1dError>
fn eval_integ( &self, xa: &[f64], ya: &[f64], a: f64, b: f64, acc: &mut Accelerator, ) -> Result<f64, Domain1dError>
Returns the numerical integral of an interpolated function over the range [
a ,b], using the
data arrays xa and ya and the Accelerator acc. Read moreAuto Trait Implementations§
impl Freeze for LinearInterpolator
impl RefUnwindSafe for LinearInterpolator
impl Send for LinearInterpolator
impl Sync for LinearInterpolator
impl Unpin for LinearInterpolator
impl UnsafeUnpin for LinearInterpolator
impl UnwindSafe for LinearInterpolator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more