NAG CL Interface
e01thc (dim3_​scat_​shep_​eval)

Settings help

CL Name Style:


1 Purpose

e01thc evaluates the three-dimensional interpolating function generated by e01tgc and its first partial derivatives.

2 Specification

#include <nag.h>
void  e01thc (Integer m, const double x[], const double y[], const double z[], const double f[], const Integer iq[], const double rq[], Integer n, const double u[], const double v[], const double w[], double q[], double qx[], double qy[], double qz[], NagError *fail)
The function may be called by the names: e01thc, nag_interp_dim3_scat_shep_eval or nag_3d_shep_eval.

3 Description

e01thc 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 e01tgc, and evaluates the interpolant and its first partial derivatives at the set of points (ui,vi,wi), for i=1,2,,n.
e01thc must only be called after a call to e01tgc.
This function is derived from the function 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] const double Input
3: y[m] const double Input
4: z[m] const double Input
5: f[m] const double Input
On entry: m, x, y, z and f must be the same values as were supplied in the preceding call to e01tgc.
6: iq[dim] const Integer Input
On entry: must be unchanged from the value returned from a previous call to e01tgc.
7: rq[dim] const double Input
On entry: must be unchanged from the value returned from a previous call to e01tgc.
8: n Integer Input
On entry: n, the number of evaluation points.
Constraint: n1.
9: u[n] const double Input
10: v[n] const double Input
11: w[n] const double Input
On entry: u[i-1], v[i-1], w[i-1] must be set to the evaluation point (ui,vi,wi), for i=1,2,,n.
12: q[n] double Output
On exit: q[i-1] 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 e01thc returns with fail.code= NE_BAD_POINT.
13: qx[n] double Output
14: qy[n] double Output
15: qz[n] double Output
On exit: qx[i-1], qy[i-1], qz[i-1] 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 e01thc returns with fail.code= NE_BAD_POINT.
16: fail NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

6 Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_BAD_POINT
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.
NE_INT
On entry, m=value.
Constraint: m10.
On entry, n=value.
Constraint: n1.
NE_INT_ARRAY
On entry, values in iq appear to be invalid. Check that iq has not been corrupted between calls to e01tgc and e01thc.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.
NE_REAL_ARRAY
On entry, values in rq appear to be invalid. Check that rq has not been corrupted between calls to e01tgc and e01thc.

7 Accuracy

Computational errors should be negligible in most practical situations.

8 Parallelism and Performance

e01thc is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
e01thc 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 function. 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 e01thc 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.

10 Example

See e01tgc.