XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ bsplev()

void bsplev ( double  t[],
double  ad[],
int  n,
int  k,
int  nderiv,
double  x,
int *  inev,
double  svalue[],
double  work[],
int *  info 
)

Evaluation of function and derivative values for B-representation of B-spline

Purpose
This routine computes the value of the B-spline and its derivatives at x from the B-representation (t[], a[], n, k) and returns them in svalue[i] (i = 0 to nderiv-1), where t[k-1] <= x <= t[n].

ad[i] can be the B-spline coefficients a[i] (i = 0 to n-1) if nderiv = 1. Otherwise ad[] must be computed beforehand by the following statement.
bspldr(t, a, n, k, nderiv, ad);
void bspldr(double t[], double a[], int n, int k, int nderiv, double ad[], int *info)
Construct a divided difference table from B-representation for derivative calculation by bsplev
Definition bspldr.c:107
If x = t[i] (k-1 <= i <= n-1), right limiting values are obtained. To compute left derivatives or left limiting values at a knot t[i], replace n by i-1 and set x = t[i] (k <= i <= n).
Parameters
[in]t[]Array t[lt] (lt >= n + k)
Knot vector.
[in]ad[]Array ad[lad] (lad >= (2*n - nderiv + 1)*nderiv/2)
Divided difference table.
[in]nNumber of B-spline coefficients. (n = sum of knot multiplicities - k)
[in]kOrder of B-spline. (k >= 1)
[in]nderivNumber of the derivatives. (1 <= nderiv <= k)
nderiv = 1 returns the zero-th derivative = function value.
[in]xArgumrnt. (t[k-1] <= x <= t[n])
[in,out]inevAn initialization parameter.
[in] Must be set to 1 when the first time bslpev is called.
[out] Information for efficient processing after the initial call and inev must not be changed by the user. Distinct splines require distinct inev parameters.
[out]svalue[]Array svalue[lsvalue] (lsvalue >= nderiv)
The spline value in svalue[0] and the nderiv-1 derivatives in the remaining components.
[out]work[]Array work[lwork] (lwork >= 3*k)
Work array.
[out]info= 0: Successful exit
= -3: The argument n had an illegal value (n < k)
= -4: The argument k had an illegal value (k < 1)
= -5: The argument nderiv had an illegal value (nderiv < 1 or nderiv > k)
= -6: The argument x had an illegal value (x < t[k-1] or x > t[n])
= 1: A left limiting value cannot be obtained at t[k-1]
Reference
SLATEC