pub struct Cubic<T>{ /* private fields */ }
Expand description
Cubic Spline.
Cubic spline with natural boundary conditions. The resulting curve is piecewise cubic on each interval, with matching first and second derivatives at the supplied data-points. The second derivative is chosen to be zero at the first and last point.
§Example
let xa = [0.0, 1.0, 2.0];
let ya = [0.0, 2.0, 4.0];
let interp = Cubic::new(&xa, &ya)?;
§Reference
Numerical Algorithms with C - Gisela Engeln-Mullges, Frank Uhlig - 1996 - Algorithm 10.1, pg 254
Trait Implementations§
Source§impl<T> Interpolation<T> for Cubic<T>
impl<T> Interpolation<T> for Cubic<T>
Source§const MIN_SIZE: usize = 3usize
const MIN_SIZE: usize = 3usize
The minimum number of points required by the interpolator. For example, Akima spline
interpolation requires a minimum of 5 points.
Source§fn new(xa: &[T], ya: &[T]) -> Result<Self, InterpolationError>where
Self: Sized,
fn new(xa: &[T], ya: &[T]) -> Result<Self, InterpolationError>where
Self: Sized,
Creates a new interpolator.
Source§fn eval(
&self,
xa: &[T],
ya: &[T],
x: T,
acc: &mut Accelerator,
) -> Result<T, DomainError>
fn eval( &self, xa: &[T], ya: &[T], x: T, acc: &mut Accelerator, ) -> Result<T, DomainError>
Returns the interpolated value y for a given point x, using the data arrays xa and ya and
the Accelerator acc. Read more
Source§fn eval_deriv(
&self,
xa: &[T],
ya: &[T],
x: T,
acc: &mut Accelerator,
) -> Result<T, DomainError>
fn eval_deriv( &self, xa: &[T], ya: &[T], x: T, acc: &mut Accelerator, ) -> Result<T, DomainError>
Returns the derivative dx/dy of an interpolated function for a given point x, using the
data arrays xa and ya and the Accelerator acc. Read more
Source§fn eval_deriv2(
&self,
xa: &[T],
ya: &[T],
x: T,
acc: &mut Accelerator,
) -> Result<T, DomainError>
fn eval_deriv2( &self, xa: &[T], ya: &[T], x: T, acc: &mut Accelerator, ) -> Result<T, DomainError>
Returns the second derivative d²x/dy² of an interpolated function for a given point x, using the
data arrays xa and ya and the Accelerator acc. Read more
Source§fn eval_integ(
&self,
xa: &[T],
ya: &[T],
a: T,
b: T,
acc: &mut Accelerator,
) -> Result<T, DomainError>
fn eval_integ( &self, xa: &[T], ya: &[T], a: T, b: T, acc: &mut Accelerator, ) -> Result<T, DomainError>
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 more
Auto Trait Implementations§
impl<T> Freeze for Cubic<T>
impl<T> RefUnwindSafe for Cubic<T>where
T: RefUnwindSafe,
impl<T> Send for Cubic<T>where
T: Send,
impl<T> Sync for Cubic<T>where
T: Sync,
impl<T> Unpin for Cubic<T>where
T: Unpin,
impl<T> UnwindSafe for Cubic<T>where
T: UnwindSafe,
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