NAG FL Interface
e01tnf (dim5_scat_shep_eval)
1
Purpose
e01tnf evaluates the five-dimensional interpolating function generated by
e01tmf and its first partial derivatives.
2
Specification
Fortran Interface
Integer, Intent (In) |
:: |
m, iq(2*m+1), n |
Integer, Intent (Inout) |
:: |
ifail |
Real (Kind=nag_wp), Intent (In) |
:: |
x(5,m), f(m), rq(21*m+11), xe(5,n) |
Real (Kind=nag_wp), Intent (Out) |
:: |
q(n), qx(5,n) |
|
C Header Interface
#include <nag.h>
void |
e01tnf_ (const Integer *m, const double x[], const double f[], const Integer iq[], const double rq[], const Integer *n, const double xe[], double q[], double qx[], Integer *ifail) |
|
C++ Header Interface
#include <nag.h> extern "C" {
void |
e01tnf_ (const Integer &m, const double x[], const double f[], const Integer iq[], const double rq[], const Integer &n, const double xe[], double q[], double qx[], Integer &ifail) |
}
|
The routine may be called by the names e01tnf or nagf_interp_dim5_scat_shep_eval.
3
Description
e01tnf takes as input the interpolant
,
of a set of scattered data points
, for
, as computed by
e01tmf, and evaluates the interpolant and its first partial derivatives at the set of points
, for
.
e01tnf must only be called after a call to
e01tmf.
e01tnf is derived from the new implementation of QS3GRD described by
Renka (1988). It uses the modification for five-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
Arguments
-
1:
– Integer
Input
-
On entry:
must be the same value supplied for argument
m in the preceding call to
e01tmf.
Constraint:
.
-
2:
– Real (Kind=nag_wp) array
Input
-
On entry:
must be the same array supplied as argument
x in the preceding call to
e01tmf. It
must remain unchanged between calls.
-
3:
– Real (Kind=nag_wp) array
Input
-
On entry:
must be the same array supplied as argument
f in the preceding call to
e01tmf. It
must remain unchanged between calls.
-
4:
– Integer array
Input
-
On entry:
must be the same array returned as argument
iq in the preceding call to
e01tmf. It
must remain unchanged between calls.
-
5:
– Real (Kind=nag_wp) array
Input
-
On entry:
must be the same array returned as argument
rq in the preceding call to
e01tmf. It
must remain unchanged between calls.
-
6:
– Integer
Input
-
On entry: , the number of evaluation points.
Constraint:
.
-
7:
– Real (Kind=nag_wp) array
Input
-
On entry: must be set to the evaluation point , for .
-
8:
– Real (Kind=nag_wp) array
Output
-
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
e01tnf returns with
.
-
9:
– Real (Kind=nag_wp) array
Output
-
On exit:
contains the value of the partial derivatives with respect to
of the interpolant
at
, for
, and for each of the five 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
e01tnf returns with
.
-
10:
– Integer
Input/Output
-
On entry:
ifail must be set to
,
or
to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value
or
is recommended. If message printing is undesirable, then the value
is recommended. Otherwise, the value
is recommended.
When the value or 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
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
Errors or warnings detected by the routine:
-
On entry, .
Constraint: .
On entry, .
Constraint: .
-
On entry, values in
iq appear to be invalid. Check that
iq has not been corrupted between calls to
e01tmf and
e01tnf.
On entry, values in
rq appear to be invalid. Check that
rq has not been corrupted between calls to
e01tmf and
e01tnf.
-
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.
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.
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.
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
e01tnf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
e01tnf 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.
The time taken for a call to e01tnf 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.1
Internal Changes
Internal changes have been made to this routine as follows:
- At Mark 26.0: The algorithm used by this routine, based on a Modified Shepard method, has been changed to produce more reliable results for some data sets which were previously not well handled. In addition, handling of evaluation points which are far away from the original data points has been improved by use of an extrapolation method which returns useful results rather than just an error message as was done at earlier Marks.
- At Mark 26.1: The algorithm has undergone further changes which enable it to work better on certain data sets, for example data presented on a regular grid. The results returned when evaluating the function at points which are not in the original data set used to construct the interpolating function are now likely to be slightly different from those returned at previous Marks of the Library, but the function still interpolates the original data.
For details of all known issues which have been reported for the NAG Library please refer to the
Known Issues.
10
Example
This program evaluates the function
at a set of
randomly generated data points and calls
e01tmf to construct an interpolating function
. It then calls
e01tnf to evaluate the interpolant at a set of random points.
To reduce the time taken by this example, the number of data points is limited to . Increasing this value to the suggested minimum of improves the interpolation accuracy at the expense of more time.
See also
Section 10 in
e01tmf.
10.1
Program Text
10.2
Program Data
10.3
Program Results