Computes the integral on (x1,x2)
of a product of a
function fun
and the idx
-th derivative of a kx
-th order b-spline,
using the b-representation (tx,bcoef,nx,kx)
, with an adaptive
8-point Legendre-Gauss algorithm.
(x1,x2)
must be a subinterval of t(kx) <= x <= t(nx+1)
.
Note
This one is not pure, because we are not enforcing
that the user function fun
be pure.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
procedure(b1fqad_func) | :: | fun |
external function of one argument for the
integrand |
|||
real(kind=wp), | intent(in), | dimension(nx+kx) | :: | tx |
knot array |
|
real(kind=wp), | intent(in), | dimension(nx) | :: | bcoef |
b-spline coefficient array |
|
integer(kind=ip), | intent(in) | :: | nx |
length of coefficient array |
||
integer(kind=ip), | intent(in) | :: | kx |
order of b-spline, |
||
integer(kind=ip), | intent(in) | :: | idx |
order of the spline derivative, |
||
real(kind=wp), | intent(in) | :: | x1 |
left point of quadrature interval in |
||
real(kind=wp), | intent(in) | :: | x2 |
right point of quadrature interval in |
||
real(kind=wp), | intent(in) | :: | tol |
desired accuracy for the quadrature, suggest
|
||
real(kind=wp), | intent(out) | :: | f |
integral of |
||
integer(kind=ip), | intent(out) | :: | iflag |
status flag:
|
||
real(kind=wp), | intent(inout), | dimension(3_ip*kx) | :: | w0 |
work array for dbfqad |
subroutine db1fqad(fun,tx,bcoef,nx,kx,idx,x1,x2,tol,f,iflag,w0) implicit none procedure(b1fqad_func) :: fun !! external function of one argument for the !! integrand `bf(x)=fun(x)*dbvalu(tx,bcoef,nx,kx,id,x,inbv,work)` integer(ip),intent(in) :: nx !! length of coefficient array integer(ip),intent(in) :: kx !! order of b-spline, `kx >= 1` real(wp),dimension(nx+kx),intent(in):: tx !! knot array real(wp),dimension(nx),intent(in) :: bcoef !! b-spline coefficient array integer(ip),intent(in) :: idx !! order of the spline derivative, `0 <= idx <= k-1` !! `idx=0` gives the spline function real(wp),intent(in) :: x1 !! left point of quadrature interval in `t(k) <= x <= t(n+1)` real(wp),intent(in) :: x2 !! right point of quadrature interval in `t(k) <= x <= t(n+1)` real(wp),intent(in) :: tol !! desired accuracy for the quadrature, suggest !! `10*dtol < tol <= 0.1` where `dtol` is the maximum !! of `1.0e-300` and real(wp) unit roundoff for !! the machine real(wp),intent(out) :: f !! integral of `bf(x)` on `(x1,x2)` integer(ip),intent(out) :: iflag !! status flag: !! !! * \( = 0 \) : no errors !! * \( \ne 0 \) : error real(wp),dimension(3_ip*kx),intent(inout) :: w0 !! work array for [[dbfqad]] call dbfqad(fun,tx,bcoef,nx,kx,idx,x1,x2,tol,f,iflag,w0) end subroutine db1fqad