NAG Library Routine Document
E01ZNF
1 Purpose
E01ZNF evaluates the multi-dimensional interpolating function generated by
E01ZMF and its first partial derivatives.
2 Specification
SUBROUTINE E01ZNF (
D,
M,
X,
F,
IQ,
RQ,
N,
XE,
Q,
QX,
IFAIL)
INTEGER
D, M, IQ(2*M+1), N, IFAIL
REAL (KIND=nag_wp)
X(D,M), F(M), RQ(*), XE(D,N), Q(N), QX(D,N)
3 Description
E01ZNF takes as input the interpolant
,
of a set of scattered data points
, for
, as computed by
E01ZMF, and evaluates the interpolant and its first partial derivatives at the set of points
, for
.
E01ZNF must only be called after a call to
E01ZMF.
E01ZNF is derived from the new implementation of QS3GRD described by
Renka (1988). It uses the modification for high-dimensional interpolation described by
Berry and Minser (1999).
4 References
Berry M W, Minser K S (1999) Algorithm 798: high-dimensional interpolation using the modified Shepard method ACM Trans. Math. Software 25 353–366
Renka R J (1988) Algorithm 661: QSHEP3D: Quadratic Shepard method for trivariate interpolation of scattered data ACM Trans. Math. Software 14 151–152
5 Parameters
- 1: D – INTEGERInput
On entry:
must be the same value supplied for parameter
D in the preceding call to
E01ZMF.
Constraint:
.
- 2: M – INTEGERInput
On entry:
must be the same value supplied for parameter
M in the preceding call to
E01ZMF.
Constraint:
.
- 3: X(D,M) – REAL (KIND=nag_wp) arrayInput
On entry:
must be the same array supplied as parameter
X in the preceding call to
E01ZMF. It
must remain unchanged between calls.
- 4: F(M) – REAL (KIND=nag_wp) arrayInput
On entry:
must be the same array supplied as parameter
F in the preceding call to
E01ZMF. It
must remain unchanged between calls.
- 5: IQ() – INTEGER arrayInput
On entry:
must be the same array returned as parameter
IQ in the preceding call to
E01ZMF. It
must remain unchanged between calls.
- 6: RQ() – REAL (KIND=nag_wp) arrayInput
-
Note: the dimension of the array
RQ
must be at least
.
On entry:
must be the same array returned as parameter
RQ in the preceding call to
E01ZMF. It
must remain unchanged between calls.
- 7: N – INTEGERInput
On entry: , the number of evaluation points.
Constraint:
.
- 8: XE(D,N) – REAL (KIND=nag_wp) arrayInput
On entry: must be set to the evaluation point , for .
- 9: Q(N) – REAL (KIND=nag_wp) arrayOutput
On exit:
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
X02ALF), and E01ZNF returns with
.
- 10: QX(D,N) – REAL (KIND=nag_wp) arrayOutput
On exit:
contains the value of the partial derivatives with respect to
of the interpolant
at
, for
, and for each of the partial derivatives
. If any of these evaluation points lie outside the region of definition of the interpolant, the corresponding entries in
QX are set to the largest machine representable number (see
X02ALF), and E01ZNF returns with
.
- 11: IFAIL – INTEGERInput/Output
-
On entry:
IFAIL must be set to
,
. If you are unfamiliar with this parameter you should refer to
Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
.
When the value 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).
6 Error Indicators and Warnings
-
On entry, exceeds the largest machine integer.
and .
On entry, .
Constraint: .
On entry, and .
Constraint: .
On entry, .
Constraint: .
-
On entry, values in
IQ appear to be invalid. Check that
IQ has not been corrupted between calls to
E01ZMF and E01ZNF.
On entry, values in
RQ appear to be invalid. Check that
RQ has not been corrupted between calls to
E01ZMF and E01ZNF.
-
On entry, at least one evaluation point lies outside the region of
definition of the interpolant. At all such points the corresponding
values in
Q and
QX have been set to
:
.
-
Dynamic memory allocation failed.
7 Accuracy
Computational errors should be negligible in most practical situations.
The time taken for a call to E01ZNF will depend in general on the distribution of the data points. If the data points are approximately uniformly distributed, then the time taken should be only . At worst time will be required.
9 Example
This program evaluates the function (in six variables)
at a set of randomly generated data points and calls
E01ZMF to construct an interpolating function
. It then calls E01ZNF to evaluate the interpolant at a set of points on the line
, for
. To reduce the time taken by this example, the number of data points is limited. Increasing this value to the suggested minimum of
improves the interpolation accuracy at the expense of more time.
9.1 Program Text
Program Text (e01znfe.f90)
9.2 Program Data
Program Data (e01znfe.d)
9.3 Program Results
Program Results (e01znfe.r)