ndsplines._npy_bspl

NumPy implementation for evaluating B-splines.

ndsplines._npy_bspl.evaluate_spline(t, k, xvals, nu, extrapolate, interval_workspace, basis_workspace)

Evaluate the k+1 non-zero B-spline basis functions for xvals.

Parameters:
  • t (ndarray, shape (n+k+1)) – Knots of spline to evaluate.
  • k (int) – Degree of spline to evaluate.
  • xvals (ndarray, shape (s,)) – Points at which to evaluate the spline.
  • nu (int) – Order of derivative to evaluate.
  • extrapolate (int, optional) – Whether to extrapolate to ouf-of-bounds points, or to return NaNs.
  • interval_workspace (ndarray, shape (s,), dtype=int) – Array used to return identified intervals, modified in-place.
  • basis_workspace (ndarray, shape (s, 2*k+2), dtype=float) – Array used to return computed values of the k+1 spline basis function at each of the input points, modified in-place.

Notes

This is a vectorized, NumPy implementation similar to the the Cython _bspl.evaluate_spline.