[][src]Function rusty_fitpack::splev

pub fn splev(
    t: Vec<f64>,
    c: Vec<f64>,
    k: usize,
    x: Vec<f64>,
    e: usize
) -> Vec<f64>

The function splev evaluates a number of points $x(i)$ with $i=1,2,...,m$ a spline $s(x)$ of degree $k$, given in its B-spline representation.

Example

Simple example of spline interpolation and evaluation

use rusty_fitpack::{splrep,splev};
let x = vec![0.5, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0];
let y = vec![0.0, 1.0, 4.0, 9.0, 16.0, 25.0, 36.0, 49.0, 64.0];

let (t, c, k) = splrep(x, y, None, None, None, None, None, None, None, None, None, None);

// the points where we want to evaluate the spline
let x_evaluate: Vec<f64> = vec![1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0];
let y_from_spline: Vec<f64> = splev(t, c, k, x_evaluate, 0);

Arguments:

t : position of the knots.
c : b-spline coefficients.
k : the degree of $s(x)$.
x : points where $s(x)$ must be evaluated.
e : if 0 the spline is extrapolated from the end spans for points not in the support, if 1 the spline evaluates to zero for those points, if 2 ier is set to 1 and the subroutine returns, and if 3 the spline evaluates to the value of the nearest boundary point.

Output:

y : the value of s(x) at the different points.

Restrictions:

$m >= 1$

$t(k+1) <= x(i) <= x(i+1) <= t(n-k)$ with $i = 1, 2,...,m-1$

References

[1] De Boor, C. On calculating with B-splines, J. Approximation Theory, 6 (1972) 50-62.
[2] Cox, M.G., The numerical evaluation of B-splines, J. Inst. Maths Applics 10 (1972) 134-149.
[3] Dierckx, P. Curve and Surface fitting with splines, Monographs on Numerical Analysis, Oxford University Press, 1993.