Skip to main content

make_interp_spline

Function make_interp_spline 

Source
pub fn make_interp_spline(
    x: &[f64],
    y: &[f64],
    k: usize,
    bc: &BoundaryCondition,
) -> Result<BSpline, ErrorsJSL>
Expand description

The interpolating spline of degree k through (x, y) (SciPy’s make_interp_spline).

For k = 0 and k = 1 the spline is piecewise constant or linear. Otherwise the knots are chosen from the data (not-a-knot, or the data points with k copies of each end when derivatives are given), and the n interpolation conditions s(xᵢ) = yᵢ together with the end conditions form a banded linear system for the coefficients. Periodic splines solve a cyclic system for n − 1 free coefficients.