NAG FL Interface
d01rbf (withdraw_​1d_​gen_​vec_​multi_​diagnostic)

Note: this routine is deprecated and will be withdrawn at Mark 28. There is no replacement for this routine.
please be advised that d01rbf has been deprecated. You are advised to follow the directions in Section 9.1 in d01raf to replicate its functionality. Furthermore, any future diagnostic enhancements for d01raf will only be available in this manner.
Settings help

FL Name Style:


FL Specification Language:


1 Purpose

d01rbf is an expert diagnostic routine associated with d01raf to allow the arrays icom and com to be examined. These arrays contain details of the adaptive process. Facilities are provided, via the argument monit, to refine the final answer by adjusting the contribution made by specific segments.

2 Specification

Fortran Interface
Subroutine d01rbf ( monit, ni, dinest, errest, icom, licom, licusd, com, lcom, lcusd, iuser, ruser, ifail)
Integer, Intent (In) :: ni, icom(licom), licom, lcom
Integer, Intent (Inout) :: iuser(*), ifail
Integer, Intent (Out) :: licusd, lcusd
Real (Kind=nag_wp), Intent (In) :: com(lcom)
Real (Kind=nag_wp), Intent (Inout) :: dinest(ni), errest(ni), ruser(*)
External :: monit
C Header Interface
#include <nag.h>
void  d01rbf_ (
void (NAG_CALL *monit)(const Integer *ni, const Integer *ns, double dinest[], double errest[], const Integer fcount[], const Integer sinfoi[], const Integer evals[], const Integer *ldi, const double sinfor[], const double fs[], const double es[], const Integer *ldr, Integer iuser[], double ruser[]),
const Integer *ni, double dinest[], double errest[], const Integer icom[], const Integer *licom, Integer *licusd, const double com[], const Integer *lcom, Integer *lcusd, Integer iuser[], double ruser[], Integer *ifail)
The routine may be called by the names d01rbf or nagf_quad_withdraw_1d_gen_vec_multi_diagnostic.

3 Description

The principal role of d01rbf is to take information about the adaptive process that is stored in com and icom and present it in more intelligible arguments. A monitor routine, monit, allows you to report the progress of the adaptive process back to the calling program between those calls of d01raf which have returned irevcm=11 or 12.
A secondary role, useful only if you are an expert, is to utilize monit in such a way that it can override aspects of that information. Specifically, you may choose to remove the contributions of one or more individual segments from the estimates for individual integrals contained in dinest and errest, and replace such information with a more accurate approximation you have calculated by some other means. Clearly this facility should only be used with care. We recommend that it be used only after d01raf has returned with irevcm=0, i.e., it has completed the computation of the approximations of the integrals.

4 References

None.

5 Arguments

1: monit Subroutine, supplied by the NAG Library or the user. External Procedure
monit allows you to examine details of the adaptive process after a call of d01raf returning irevcm=11 or 12. Additionally, after a call of d01raf returning irevcm=0, monit may enhance the computed solution.
If no monitoring is required, monit may be the dummy monitoring routine d01rbm. (d01rbm is included in the NAG Library.)
The specification of monit is:
Fortran Interface
Subroutine monit ( ni, ns, dinest, errest, fcount, sinfoi, evals, ldi, sinfor, fs, es, ldr, iuser, ruser)
Integer, Intent (In) :: ni, ns, fcount(ni), sinfoi(ldi,*), evals(ldi,*), ldi, ldr
Integer, Intent (Inout) :: iuser(*)
Real (Kind=nag_wp), Intent (In) :: sinfor(ldr,*), fs(ldr,*), es(ldr,*)
Real (Kind=nag_wp), Intent (Inout) :: dinest(ni), errest(ni), ruser(*)
C Header Interface
void  monit (const Integer *ni, const Integer *ns, double dinest[], double errest[], const Integer fcount[], const Integer sinfoi[], const Integer evals[], const Integer *ldi, const double sinfor[], const double fs[], const double es[], const Integer *ldr, Integer iuser[], double ruser[])
1: ni Integer Input
On entry: ni, the number of integrands specified in d01raf.
2: ns Integer Input
On entry: ns, the number of segments formed during the adaptive procedure that can currently be examined. ns=2nsdiv+spri, where nsdiv is the number of segments that have been subdivided (the number of subdivisions).
3: dinest(ni) Real (Kind=nag_wp) array Input/Output
On entry: dinest(j) contains the current estimate of the definite integral of integrand j, for j=1,2,,ni.
On exit: you may refine the estimates in dinest. This should only be done after d01raf has returned irevcm=0.
4: errest(ni) Real (Kind=nag_wp) array Input/Output
On entry: errest(j) contains the current error estimate associated with integral j, for j=1,2,,ni.
On exit: you may refine the estimates in errest. This should only be done after d01raf has returned irevcm=0.
5: fcount(ni) Integer array Input
On entry: fcount(j) contains the number of different approximations of integral j calculated so far, for j=1,2,,ni.
6: sinfoi(ldi,*) Integer array Input
On entry: sinfoi(l,k) contains information about the hierarchy of splitting, for l=1,2,,5 and k=1,2,,ns.
sinfoi(1,k)
Contains a unique identifier, the sid, related to segment k.
sinfoi(2,k)
Contains the parent segment number of segment k, the reference to the segment that was split to create segment k.
sinfoi(3,k) and sinfoi(4,k)
Contain the segment numbers of the two child segments formed from segment k, if segment k has been split. If segment k has not been split, these will be negative.
sinfoi(5,k)
Contains the level at which the segment exists, corresponding to na+1, where na is the number of ancestor segments of segment k.
If sinfoi(5,k)<0, this segment is considered too small for further splitting, and its level is |sinfoi(5,k)|.
7: evals(ldi,*) Integer array Input
On entry: contains information to indicate whether an estimate of the integral j has been obtained over segment k, and if so whether this evaluation still contributes to the approximation in dinest(j), for j=1,2,,ni and k=1,2,,ns.
evals(j,k)=0
Indicates that integral j has not been evaluated over segment k.
evals(j,k)=1
Indicates that integral j has been evaluated over segment k, and that this evaluation contributes to the total approximation dinest(j).
evals(j,k)=2
Indicates that integral j has been evaluated over segment k, that this evaluation contributes to the total approximation dinest(j), and that you have requested no further evaluation of this integral at this segment by setting needi(j)<0 in d01raf.
evals(j,k)=3
Indicates that integral j has been evaluated over segment k, and this evaluation no longer contributes to dinest(j).
evals(j,k)=4
Indicates that integral j has been evaluated over segment k, that this evaluation contributes to the total approximation dinest(j), and that this segment is too small for any further splitting to be performed. Integral j also has a local error estimate over this segment above the requested tolerance. Such segments cause d01raf to return ifail=2 or 3, indicating extremely bad behaviour.
evals(j,k)=5
Indicates that integral j has been evaluated over segment k, that this evaluation contributes to the total approximation of dinest(j), and that this segment is too small for any further splitting to be performed. The local error estimate is however below the requested tolerance.
8: ldi Integer Input
On entry: the leading dimension of arrays sinfoi and evals.
9: sinfor(ldr,*) Real (Kind=nag_wp) array Input
On entry: sinfor contains the bounds of each segment k, for k=1,2,,ns.
sinfor(1,k)
Contains the lower bound of segment k.
sinfor(2,k)
Contains the upper bound of segment k.
10: fs(ldr,*) Real (Kind=nag_wp) array Input
On entry: fs(j,k) contains the definite integral estimate of the jth integral over the kth segment, for j=1,2,,ni and k=1,2,,ns.
11: es(ldr,*) Real (Kind=nag_wp) array Input
On entry: es(j,k) contains the definite integral error estimate of the jth integral over the kth segment, for j=1,2,,ni and k=1,2,,ns.
12: ldr Integer Input
On entry: the leading dimension of arrays sinfor, fs and es.
13: iuser(*) Integer array User Workspace
14: ruser(*) Real (Kind=nag_wp) array User Workspace
monit is called with the arguments iuser and ruser as supplied to d01rbf. You should use the arrays iuser and ruser to supply information to monit.
monit must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which d01rbf is called. Arguments denoted as Input must not be changed by this procedure.
Note: monit should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by d01rbf. If your code inadvertently does return any NaNs or infinities, d01rbf is likely to produce unexpected results.
2: ni Integer Input
On entry: ni, the number of integrals.
3: dinest(ni) Real (Kind=nag_wp) array Input/Output
On entry: dinest(j) contains the current estimate of the definite integral of integrand j, for j=1,2,,ni.
On exit: dinest is not altered by d01rbf directly. It may be changed by monit.
4: errest(ni) Real (Kind=nag_wp) array Input/Output
On entry: errest(j) contains the current error estimate associated with integral j, for j=1,2,,ni.
On exit: errest is not altered by d01rbf directly. It may be changed by monit.
5: icom(licom) Integer array Communication Array
On entry: the elements of this array must not be changed since the call of d01raf.
6: licom Integer Input
On entry: the dimension of the array icom as declared in the (sub)program from which d01rbf is called. Normally this will be the same value licom passed to d01raf.
Constraint: licom50.
Note: if licom<licusd, (i.e., licom is less than the value passed to d01raf) not all segments may be investigated using monit (see argument ns) and d01rbf will return ifail=1.
7: licusd Integer Output
On exit: the number of elements of the array icom, passed to d01raf, actually used.
8: com(lcom) Real (Kind=nag_wp) array Communication Array
On entry: the elements of this array must not be changed since the call of d01raf.
9: lcom Integer Input
On entry: the dimension of the array com as declared in the (sub)program from which d01rbf is called. Normally this will be the same value lcom passed to d01raf.
Constraint: lcom50.
Note: if lcom<lcusd, (i.e., lcom is less than the value passed to d01raf) not all segments may be investigated using monit (see argument ns) and d01rbf will return ifail=1.
10: lcusd Integer Output
On exit: the number of elements of com used by d01raf.
11: iuser(*) Integer array User Workspace
12: ruser(*) Real (Kind=nag_wp) array User Workspace
iuser and ruser are not used by d01rbf, but are passed directly to monit and may be used to pass information to this routine.
13: ifail Integer Input/Output
On entry: ifail must be set to 0, -1 or 1 to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of 0 causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of -1 means that an error message is printed while a value of 1 means that it is not.
If halting is not appropriate, the value -1 or 1 is recommended. If message printing is undesirable, then the value 1 is recommended. Otherwise, the value -1 is recommended since useful values can be provided in some output arguments even when ifail0 on exit. When the value -1 or 1 is used it is essential to test the value of ifail on exit.
On exit: ifail=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6 Error Indicators and Warnings

If on entry ifail=0 or -1, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
Note: in some cases d01rbf may return useful information.
ifail=1
On entry, licom=value, lcom=value.
licom or lcom is insufficient for a complete examination of the communication arrays. A maximum value segments out of value are examinable.
Constraint: licomvalue and lcomvalue.
ifail=21
On entry, ni is not consistent with that used to construct the communication arrays.
On entry, ni=value.
Constraint: ni=value.
ifail=61
On entry, licom<50.
ifail=91
On entry, lcom<50.
ifail=1101
Either the communication arrays have not been created by d01raf, or they have become corrupted.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

7 Accuracy

Not applicable.

8 Parallelism and Performance

d01rbf is not threaded in any implementation.

9 Further Comments

When called after d01raf has returned irevcm=0, d01rbf may be used to modify dinest and errest. For example if evals(j,k¯) =4 for some j1,,ni, k¯1,,ns, indicating integral j was badly behaved over segment k¯, then one may potentially modify dinest(j) as follows:
errest may be similarly updated if required.
Note: if integral j has been approximated successfully due to extrapolation, indicated by needi(j)=1 after d01raf has completed, dinest(j) will not be the direct sum of the contributing segments. You may however reconstruct the unextrapolated integral estimate as,
dinest(j) = K fs(j,k) + K¯ fs(j,k¯) ,  
where K={kevals(ldi×(k)+j)=1,2,5} and K¯={k¯evals(ldi×(k¯)+j)=4}, the sets of all contributing segements where integral j has been evaluated accurately and inaccurately respectively. Some or all of the terms in the summation over K¯ may be replaced with more accurate approximations Fk¯new if available.

10 Example

See d01raf.