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

◆ bvalue()

double bvalue ( double  t[],
double  a[],
int  n,
int  k,
int  ideriv,
double  x,
int *  inbv,
double  work[],
int *  info 
)

Evaluation of function or derivative value for B-spline

Purpose
This routine evaluates the B-representation (t[], a[], n, k) of a B-spline at x for the function value on ideriv = 0 or any of its derivatives on ideriv = 1, 2, ..., k-1. Right limiting values (right derivatives) are returned except at the right end point x = t[n] where left limiting values are computed. The spline is defined on t[k-1] <= x <= t[n]. bvalue returns a fatal error when x is outside of this interval.
To compute left derivatives or left limiting values at a knot t[i], replace n by i-1 and set x = t[i], i = k to n.
Returns
Value of the ideriv-th derivative at x.
Parameters
[in]t[]Array t[lt] (lt >= n + k)
Knot vector.
[in]a[]Array a[la] (la >= n)
B-spline coefficients.
[in]nNumber of B-spline coefficients. (n = sum of knot multiplicities - k)
[in]kOrder of B-spline. (k >= 1)
[in]iderivOrder of the derivative. (0 <= ideriv <= k - 1)
If ideriv = 0, returns the B-spline value.
[in]xArgument x. (t[k-1] <= x <= t[n])
[in,out]inbvAn initialization parameter.
[in] Must be set to 1 when the first time bvalue is called.
[out] Information for efficient processing after the initial call and inbv must not be changed by the user. Distinct splines require distinct inbv parameters.
[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 ideriv had an illegal value (ideriv < 0 or ideriv >= 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