pub struct PolynomialInterpolator<'a> { /* private fields */ }Expand description
The polynomial of degree n − 1 through n points, in Newton’s divided-difference form,
evaluated by Horner’s scheme (O(n) per point after O(n²) set-up). The abscissas must be
distinct. For many points, or points that are not well spread, prefer the numerically stabler
barycentric form of LagrangeInterpolant.
See the book entry Polynomial interpolation.
Implementations§
Trait Implementations§
Source§impl<'a> Debug for PolynomialInterpolator<'a>
impl<'a> Debug for PolynomialInterpolator<'a>
Source§impl<'a> InterpolationTrait<'a> for PolynomialInterpolator<'a>
impl<'a> InterpolationTrait<'a> for PolynomialInterpolator<'a>
Source§fn raw_interpolate(&mut self, _: usize, _: f64) -> Result<f64, ErrorsJSL>
fn raw_interpolate(&mut self, _: usize, _: f64) -> Result<f64, ErrorsJSL>
Not used: the polynomial is global, so interpolate_at
evaluates it directly.
Source§fn interpolate_at(&mut self, x: f64) -> Result<f64, ErrorsJSL>
fn interpolate_at(&mut self, x: f64) -> Result<f64, ErrorsJSL>
Evaluate the Newton interpolating polynomial at a given x.
Uses Horner’s method for efficiency.
Source§fn get_x_values(&self) -> VR1D<'a>
fn get_x_values(&self) -> VR1D<'a>
Setters and getters for required fields
fn set_x_values(&mut self, x: VR1D<'a>)
fn get_y_values(&self) -> VR1D<'a>
fn set_y_values(&mut self, y: VR1D<'a>)
fn get_cached_location(&self) -> Option<usize>
fn set_cached_location(&mut self, _: usize)
Source§fn x_range_is_ascending(&self) -> bool
fn x_range_is_ascending(&self) -> bool
Check if x range is ascending
Auto Trait Implementations§
impl<'a> Freeze for PolynomialInterpolator<'a>
impl<'a> RefUnwindSafe for PolynomialInterpolator<'a>
impl<'a> Send for PolynomialInterpolator<'a>
impl<'a> Sync for PolynomialInterpolator<'a>
impl<'a> Unpin for PolynomialInterpolator<'a>
impl<'a> UnsafeUnpin for PolynomialInterpolator<'a>
impl<'a> UnwindSafe for PolynomialInterpolator<'a>
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