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

◆ bfqad_r()

void bfqad_r ( double  t[],
double  bcoef[],
int  n,
int  k,
int  id,
double  x1,
double  x2,
double  tol,
double *  quad,
double  work[],
int *  info,
double *  xx,
double  yy,
int *  irev 
)

Integral of product of arbitrary function and B-representation of B-spline (reverse communication version)

Purpose
This routine computes the integral on [x1, x2] of a product of a function f(x) and the id-th derivative of a k-th order B-spline, using the B-representation (t[], bcoef[], n,k). [x1, x2] must be a subinterval of [t[k-1], t[k]].

Then integration routine using adaptive 8-point Gauss-Legendre rule integrates the product on subintervals of [x1, x2] formed by included (distinct) knots.
Parameters
[in]t[]Array t[lt] (lt >= n + k)
Knot vector.
[in]bcoef()Array bcoef[lbcoef] (lbcoef >= n)
B-spline coefficients.
[in]nNumber of B-spline coefficients. (n = sum of knot multiplicities - k)
[in]kOrder of B-spline. (1 <= k)
[in]idOrder of the spline derivative. (0 <= id <= k - 1)
id = 0 gives the spline function.
[in]x1Lower end point of quadrature interval. (t[k] <= x1 <= t[n+1])
[in]x2Upper end point of quadrature interval. (t[k] <= x2 <= t[n+1])
[in]tolDesired accuracy for the quadrature. (dtol < tol <= 0.1 where dtol is max(1.0e-18, double precision unit roundoff for the machine (= d1mach(4))).
[out]quadIntegral of f(x)*(id-th derivative of a k-th order B-spline) on [x1, x2].
[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 id had an illegal value (id < 0 or id >= k)
= -6: The argument x1 had an illegal value (x1 < t[k-1] or x1 > t[n])
= -7: The argument x2 had an illegal value (x2 < t[k-1] or x2 > t[n])
= -8: The argument tol had an illegal value (tol < dtol or tol > 0.1)
= 1: Some quadrature on [x1, x2] does not meet the requested tolerance
[out]xxWhen returned with irev=1 to 3, xx contains the abscissa where the function value shoule be evaluated and given in the next call.
[in]yyWhen returned with irev = 1 to 3, the function value f(xx) should be given in yy in the next call.
[in,out]irevControl variable for reverse communication.
[in] Before first call, irev should be initialized to zero. On succeeding calls, irev should not be altered.
[out] If irev is not zero, complete the following process and call this routine again.
= 0: Computation finished. See return code in info.
= 1 to 3: User should set the function value at xx (f(xx)) in yy. Do not alter any variables other than yy.
Reference
SLATEC