PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_interp_3d_scat_shep_eval (e01th)
Purpose
nag_interp_3d_scat_shep_eval (e01th) evaluates the three-dimensional interpolating function generated by
nag_interp_3d_scat_shep (e01tg) and its first partial derivatives.
Syntax
[
q,
qx,
qy,
qz,
ifail] = e01th(
x,
y,
z,
f,
iq,
rq,
u,
v,
w, 'm',
m, 'n',
n)
[
q,
qx,
qy,
qz,
ifail] = nag_interp_3d_scat_shep_eval(
x,
y,
z,
f,
iq,
rq,
u,
v,
w, 'm',
m, 'n',
n)
Description
nag_interp_3d_scat_shep_eval (e01th) takes as input the interpolant
of a set of scattered data points
, for
, as computed by
nag_interp_3d_scat_shep (e01tg),
and evaluates the interpolant and its first partial derivatives at the set of points
, for
.
nag_interp_3d_scat_shep_eval (e01th) must only be called after a call to
nag_interp_3d_scat_shep (e01tg).
This function is derived from the function QS3GRD described by
Renka (1988).
References
Renka R J (1988) Algorithm 661: QSHEP3D: Quadratic Shepard method for trivariate interpolation of scattered data ACM Trans. Math. Software 14 151–152
Parameters
Compulsory Input Parameters
- 1:
– double array
- 2:
– double array
- 3:
– double array
- 4:
– double array
-
m,
x,
y,
z and
f must be the same values as were supplied in the preceding call to
nag_interp_3d_scat_shep (e01tg).
- 5:
– int64int32nag_int array
-
liq, the dimension of the array, must satisfy the constraint
.
Must be unchanged from the value returned from a previous call to
nag_interp_3d_scat_shep (e01tg).
- 6:
– double array
-
lrq, the dimension of the array, must satisfy the constraint
.
Must be unchanged from the value returned from a previous call to
nag_interp_3d_scat_shep (e01tg).
- 7:
– double array
- 8:
– double array
- 9:
– double array
-
, , must be set to the evaluation point , for .
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the dimension of the arrays
x,
y,
z,
f. (An error is raised if these dimensions are not equal.)
m,
x,
y,
z and
f must be the same values as were supplied in the preceding call to
nag_interp_3d_scat_shep (e01tg).
- 2:
– int64int32nag_int scalar
-
Default:
the dimension of the arrays
u,
v,
w. (An error is raised if these dimensions are not equal.)
, the number of evaluation points.
Constraint:
.
Output Parameters
- 1:
– double array
-
contains the value of the interpolant, at
, for
. If any of these evaluation points lie outside the region of definition of the interpolant the corresponding entries in
q are set to the largest machine representable number (see
nag_machine_real_largest (x02al)), and
nag_interp_3d_scat_shep_eval (e01th) returns with
.
- 2:
– double array
- 3:
– double array
- 4:
– double array
-
,
,
contains the value of the partial derivatives of the interpolant
at
, for
. 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 the largest machine representable number (see
nag_machine_real_largest (x02al)), and
nag_interp_3d_scat_shep_eval (e01th) returns with
.
- 5:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
Cases prefixed with W are classified as warnings and
do not generate an error of type NAG:error_n. See nag_issue_warnings.
-
-
On entry, | , |
or | , |
or | , |
or | . |
-
-
Values supplied in
iq or
rq appear to be invalid. Check that these arrays have not been corrupted between the calls to
nag_interp_3d_scat_shep (e01tg) and
nag_interp_3d_scat_shep_eval (e01th).
- W
-
At least one evaluation point lies outside the region of definition of the interpolant. At all such points the corresponding values in
q,
qx,
qy and
qz have been set to the largest machine representable number (see
nag_machine_real_largest (x02al)).
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
Computational errors should be negligible in most practical situations.
Further Comments
The time taken for a call to
nag_interp_3d_scat_shep_eval (e01th) 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
. At worst
time will be required.
Example
See
Example in
nag_interp_3d_scat_shep (e01tg).
Open in the MATLAB editor:
e01th_example
function e01th_example
fprintf('e01th example results\n\n');
data = [ 0.80 0.23 0.37 0.51;
0.23 0.88 0.05 1.80;
0.18 0.43 0.04 0.11;
0.58 0.95 0.62 2.65;
0.64 0.69 0.20 0.93;
0.88 0.35 0.49 0.72;
0.30 0.10 0.78 -0.11;
0.87 0.09 0.05 0.67;
0.04 0.02 0.40 0.00;
0.62 0.90 0.43 2.20;
0.87 0.96 0.24 3.17;
0.62 0.64 0.45 0.74;
0.86 0.13 0.47 0.64;
0.87 0.60 0.46 1.07;
0.49 0.43 0.13 0.22;
0.12 0.61 0.00 0.41;
0.02 0.71 0.82 0.58;
0.62 0.93 0.44 2.48;
0.49 0.54 0.04 0.37;
0.36 0.56 0.39 0.35;
0.62 0.42 0.97 -0.20;
0.01 0.72 0.45 0.78;
0.41 0.36 0.52 0.11;
0.17 0.99 0.65 2.82;
0.51 0.29 0.59 0.14;
0.85 0.05 0.04 0.61;
0.20 0.20 0.87 -0.25;
0.04 0.67 0.04 0.59;
0.31 0.63 0.18 0.50;
0.88 0.27 0.07 0.71];
x = data(:,1); y = data(:,2); z = data(:,3); f = data(:,4);
nw = int64(0);
nq = nw;
[iq, rq, ifail] = e01tg( ...
x, y, z, f, nw, nq);
px = [0.1:0.1:0.6]'; py = px; pz = px;
[q, qx, qy, qz, ifail] = e01th( ...
x, y, z, f, iq, rq, px, py, pz);
fprintf(' Evaluation point Q(x,y,z)\n');
fprintf(' (%4.1f, %4.1f, %4.1f) %8.4f\n',[px py pz q]');
e01th example results
Evaluation point Q(x,y,z)
( 0.1, 0.1, 0.1) 0.2630
( 0.2, 0.2, 0.2) 0.1182
( 0.3, 0.3, 0.3) 0.0811
( 0.4, 0.4, 0.4) 0.1552
( 0.5, 0.5, 0.5) 0.3019
( 0.6, 0.6, 0.6) 0.5712
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015