The routine may be called by the names e01bgf or nagf_interp_dim1_monotonic_deriv.
e01bgf evaluates a piecewise cubic Hermite interpolant, as computed by e01bef, at the points , for . The first derivatives at the points are also computed. If any point lies outside the interval from to , values of the interpolant and its derivative are extrapolated from the nearest extreme cubic, and a warning is returned.
If values of the interpolant only, and not of its derivative, are required,
e01bff should be used.
Fritsch F N (1982) PCHIP final specifications Report UCID-30194 Lawrence Livermore National Laboratory
1: – IntegerInput
2: – Real (Kind=nag_wp) arrayInput
3: – Real (Kind=nag_wp) arrayInput
4: – Real (Kind=nag_wp) arrayInput
On entry: n, x, f and d must be unchanged from the previous call of e01bef.
5: – IntegerInput
On entry: , the number of points at which the interpolant is to be evaluated.
6: – Real (Kind=nag_wp) arrayInput
On entry: the values of at which the interpolant is to be evaluated.
7: – Real (Kind=nag_wp) arrayOutput
On exit: contains the value of the interpolant evaluated at the point , for .
8: – Real (Kind=nag_wp) arrayOutput
On exit: contains the first derivative of the interpolant evaluated at the point , for .
9: – IntegerInput/Output
On entry: ifail must be set to , or to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value or is recommended. If message printing is undesirable, then the value is recommended. Otherwise, the value is recommended. When the value or is used it is essential to test the value of ifail on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
6Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
On entry, .
On entry, , and .
Constraint: for all .
On entry, .
Warning – some points in array px lie outside the range . Values at these points are unreliable because computed by extrapolation.
An unexpected error has been triggered by this routine. Please
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
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.
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.
The computational errors in the arrays pf and pd should be negligible in most practical situations.
8Parallelism and Performance
e01bgf is not threaded in any implementation.
The time taken by e01bgf is approximately proportional to the number of evaluation points, . The evaluation will be most efficient if the elements of px are in nondecreasing order (or,
more generally, if they are grouped in increasing order of the intervals ). A
single call of e01bgf with is more efficient than several calls with .
This example reads in values of n, x, f and d, and calls
e01bgf to compute the values of the interpolant and its derivative at equally spaced points.