NAG FL Interface
e01thf (dim3_​scat_​shep_​eval)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

e01thf evaluates the three-dimensional interpolating function generated by e01tgf and its first partial derivatives.

2 Specification

Fortran Interface
Subroutine e01thf ( m, x, y, z, f, iq, liq, rq, lrq, n, u, v, w, q, qx, qy, qz, ifail)
Integer, Intent (In) :: m, iq(liq), liq, lrq, n
Integer, Intent (Inout) :: ifail
Real (Kind=nag_wp), Intent (In) :: x(m), y(m), z(m), f(m), rq(lrq), u(n), v(n), w(n)
Real (Kind=nag_wp), Intent (Out) :: q(n), qx(n), qy(n), qz(n)
C Header Interface
#include <nag.h>
void  e01thf_ (const Integer *m, const double x[], const double y[], const double z[], const double f[], const Integer iq[], const Integer *liq, const double rq[], const Integer *lrq, const Integer *n, const double u[], const double v[], const double w[], double q[], double qx[], double qy[], double qz[], Integer *ifail)
The routine may be called by the names e01thf or nagf_interp_dim3_scat_shep_eval.

3 Description

e01thf takes as input the interpolant Q(x,y,z) of a set of scattered data points (xr,yr,zr,fr), for r=1,2,,m, as computed by e01tgf, and evaluates the interpolant and its first partial derivatives at the set of points (ui,vi,wi), for i=1,2,,n.
e01thf must only be called after a call to e01tgf.
This routine is derived from the routine QS3GRD described by Renka (1988).

4 References

Renka R J (1988) Algorithm 661: QSHEP3D: Quadratic Shepard method for trivariate interpolation of scattered data ACM Trans. Math. Software 14 151–152

5 Arguments

1: m Integer Input
2: x(m) Real (Kind=nag_wp) array Input
3: y(m) Real (Kind=nag_wp) array Input
4: z(m) Real (Kind=nag_wp) array Input
5: f(m) Real (Kind=nag_wp) array Input
On entry: m, x, y, z and f must be the same values as were supplied in the preceding call to e01tgf.
6: iq(liq) Integer array Input
On entry: must be unchanged from the value returned from a previous call to e01tgf.
7: liq Integer Input
On entry: the dimension of the array iq as declared in the (sub)program from which e01thf is called.
Constraint: liq2×m+1.
8: rq(lrq) Real (Kind=nag_wp) array Input
On entry: must be unchanged from the value returned from a previous call to e01tgf.
9: lrq Integer Input
On entry: the dimension of the array rq as declared in the (sub)program from which e01thf is called.
Constraint: lrq10×m+7.
10: n Integer Input
On entry: n, the number of evaluation points.
Constraint: n1.
11: u(n) Real (Kind=nag_wp) array Input
12: v(n) Real (Kind=nag_wp) array Input
13: w(n) Real (Kind=nag_wp) array Input
On entry: u(i), v(i), w(i) must be set to the evaluation point (ui,vi,wi), for i=1,2,,n.
14: q(n) Real (Kind=nag_wp) array Output
On exit: q(i) contains the value of the interpolant, at (ui,vi,wi), for i=1,2,,n. If any of these evaluation points lie outside the region of definition of the interpolant the corresponding entries in q are set to an extrapolated approximation, and e01thf returns with ifail=3.
15: qx(n) Real (Kind=nag_wp) array Output
16: qy(n) Real (Kind=nag_wp) array Output
17: qz(n) Real (Kind=nag_wp) array Output
On exit: qx(i), qy(i), qz(i) contains the value of the partial derivatives of the interpolant Q(x,y,z) at (ui,vi,wi), for i=1,2,,n. If any of these evaluation points lie outside the region of definition of the interpolant, the corresponding entries in qx, qy and qz are set to extrapolated approximations to the partial derivatives, and e01thf returns with ifail=3.
18: 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 0 is recommended. 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:
ifail=1
On entry, liq is too small: liq=value.
On entry, lrq is too small: lrq=value.
On entry, m=value.
Constraint: m10.
On entry, n=value.
Constraint: n1.
ifail=2
On entry, values in iq appear to be invalid. Check that iq has not been corrupted between calls to e01tgf and e01thf.
On entry, values in rq appear to be invalid. Check that rq has not been corrupted between calls to e01tgf and e01thf.
ifail=3
On entry, at least one evaluation point lies outside the region of definition of the interpolant. At such points the corresponding values in q and qx contain extrapolated approximations. Points should be evaluated one by one to identify extrapolated values.
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

Computational errors should be negligible in most practical situations.

8 Parallelism and Performance

e01thf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
e01thf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

9 Further Comments

The time taken for a call to e01thf will depend in general on the distribution of the data points. If x, y and z are approximately uniformly distributed, then the time taken should be only O(n). At worst O(mn) time will be required.

9.1 Internal Changes

Internal changes have been made to this routine as follows:
For details of all known issues which have been reported for the NAG Library please refer to the Known Issues.

10 Example

See e01tgf.