NAG Library Routine Document
e01ebf (dim2_triang_bary_eval)
1
Purpose
e01ebf performs barycentric interpolation, at a given set of points, using a set of function values on a scattered grid and a triangulation of that grid computed by
e01eaf.
2
Specification
Fortran Interface
Integer, Intent (In) | :: | m, n, triang(7*n) | Integer, Intent (Inout) | :: | ifail | Real (Kind=nag_wp), Intent (In) | :: | x(n), y(n), f(n), px(m), py(m) | Real (Kind=nag_wp), Intent (Out) | :: | pf(m) |
|
C Header Interface
#include <nagmk26.h>
void |
e01ebf_ (const Integer *m, const Integer *n, const double x[], const double y[], const double f[], const Integer triang[], const double px[], const double py[], double pf[], Integer *ifail) |
|
3
Description
e01ebf takes as input a set of scattered data points
, for
, and a Thiessen triangulation of the
computed by
e01eaf, and interpolates at a set of points
, for
.
If the th interpolation point is equal to for some value of , the returned value will be equal to ; otherwise a barycentric transformation will be used to calculate the interpolant.
For each point , a triangle is sought which contains the point; the vertices of the triangle and values at the vertices are then used to compute the value .
If any interpolation point lies outside the triangulation defined by the input arguments, the returned value is the value provided, , at the closest node .
e01ebf must only be called after a call to
e01eaf.
4
References
Cline A K and Renka R L (1984) A storage-efficient method for construction of a Thiessen triangulation Rocky Mountain J. Math. 14 119–139
Lawson C L (1977) Software for surface interpolation Mathematical Software III (ed J R Rice) 161–194 Academic Press
Renka R L (1984) Algorithm 624: triangulation and interpolation of arbitrarily distributed points in the plane ACM Trans. Math. Software 10 440–442
Renka R L and Cline A K (1984) A triangle-based interpolation method Rocky Mountain J. Math. 14 223–237
5
Arguments
- 1: – IntegerInput
-
On entry: , the number of points to interpolate.
Constraint:
.
- 2: – IntegerInput
-
On entry:
, the number of data points.
n must be unchanged from the previous call of
e01eaf.
Constraint:
.
- 3: – Real (Kind=nag_wp) arrayInput
- 4: – Real (Kind=nag_wp) arrayInput
-
On entry: the coordinates of the
th data point,
, for
.
x and
y must be unchanged from the previous call of
e01eaf.
- 5: – Real (Kind=nag_wp) arrayInput
-
On entry: the function values
at , for .
- 6: – Integer arrayInput
-
On entry: the triangulation computed by the previous call of
e01eaf. See
Section 9 in
e01eaf for details of how the triangulation used is encoded in
triang.
- 7: – Real (Kind=nag_wp) arrayInput
- 8: – Real (Kind=nag_wp) arrayInput
-
On entry: the coordinates , for , at which interpolated function values are sought.
- 9: – Real (Kind=nag_wp) arrayOutput
-
On exit: the interpolated values , for .
- 10: – IntegerInput/Output
-
On entry:
ifail must be set to
,
. If you are unfamiliar with this argument you should refer to
Section 3.4 in How to Use the NAG Library and its Documentation 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 argument, 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
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, the triangulation information held in the array
triang does not specify a valid triangulation of the data points.
triang has been corrupted since the call to
e01eaf.
-
At least one evaluation point lies outside the nodal triangulation. For each such point the value returned in
pf is that corresponding to a node on the closest boundary line segment.
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 3.9 in How to Use the NAG Library and its Documentation for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 3.8 in How to Use the NAG Library and its Documentation for further information.
Dynamic memory allocation failed.
See
Section 3.7 in How to Use the NAG Library and its Documentation for further information.
7
Accuracy
Not applicable.
8
Parallelism and Performance
e01ebf is not threaded in any implementation.
The time taken for a call of e01ebf is approximately proportional to the number of interpolation points, .
10
Example
See
Section 10 in
e01eaf.