NAG CL Interface
e01shc (dim2_​scat_​shep_​eval)

Settings help

CL Name Style:


1 Purpose

e01shc evaluates the two-dimensional interpolating function generated by e01sgc and its first partial derivatives.

2 Specification

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

3 Description

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

4 References

Renka R J (1988) Algorithm 660: QSHEP2D: Quadratic Shepard method for bivariate interpolation of scattered data ACM Trans. Math. Software 14 149–150

5 Arguments

1: m Integer Input
2: x[m] const double Input
3: y[m] const double Input
4: f[m] const double Input
On entry: m, x, y and f must be the same values as were supplied in the preceding call to e01sgc.
5: iq[dim] const Integer Input
On entry: must be unchanged from the value returned from a previous call to e01sgc.
6: rq[dim] const double Input
On entry: must be unchanged from the value returned from a previous call to e01sgc.
7: n Integer Input
On entry: n, the number of evaluation points.
Constraint: n1.
8: u[n] const double Input
9: v[n] const double Input
On entry: the evaluation points (ui,vi), for i=1,2,,n.
10: q[n] double Output
On exit: the values of the interpolant at (ui,vi), 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 e01shc returns with fail.code= NE_BAD_INTERPOLANT.
11: qx[n] double Output
12: qy[n] double Output
On exit: the values of the partial derivatives of the interpolant Q(x,y) at (ui,vi), 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 and qy are set to extrapolated approximations to the partial derivatives, and e01shc returns with fail.code= NE_BAD_INTERPOLANT.
13: 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_INTERPOLANT
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_BAD_PARAM
On entry, argument value had an illegal value.
NE_INT
On entry, m=value.
Constraint: m6.
On entry, n=value.
Constraint: n1.
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_INVALID_ARRAY
On entry, values in iq appear to be invalid. Check that iq has not been corrupted between calls to e01sgc and e01shc.
On entry, values in rq appear to be invalid. Check that rq has not been corrupted between calls to e01sgc and e01shc.
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.

7 Accuracy

Computational errors should be negligible in most practical situations.

8 Parallelism and Performance

e01shc is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
e01shc 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 e01shc will depend in general on the distribution of the data points. If x and y are approximately uniformly distributed, then the time taken should be only O(n). At worst O(mn) time will be required.

10 Example

See e01sgc.