E01EBF (PDF version)
E01 Chapter Contents
E01 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

E01EBF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

 Contents

    1  Purpose
    7  Accuracy
    10  Example

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

SUBROUTINE E01EBF ( M, N, X, Y, F, TRIANG, PX, PY, PF, IFAIL)
INTEGER  M, N, TRIANG(7*N), IFAIL
REAL (KIND=nag_wp)  X(N), Y(N), F(N), PX(M), PY(M), PF(M)

3  Description

E01EBF takes as input a set of scattered data points xr,yr,fr , for r=1,2,,n, and a Thiessen triangulation of the xr,yr computed by E01EAF, and interpolates at a set of points pxi,pyi , for i=1,2,,m.
If the ith interpolation point pxi,pyi  is equal to xr,yr  for some value of r, the returned value will be equal to fr; otherwise a barycentric transformation will be used to calculate the interpolant.
For each point pxi,pyi , a triangle is sought which contains the point; the vertices of the triangle and fr values at the vertices are then used to compute the value F pxi,pyi .
If any interpolation point lies outside the triangulation defined by the input parameters, the returned value is the value provided, fs, at the closest node xs,ys .
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 C1 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 C1 interpolation method Rocky Mountain J. Math. 14 223–237

5  Parameters

1:     M – INTEGERInput
On entry: m, the number of points to interpolate.
Constraint: M1.
2:     N – INTEGERInput
On entry: n, the number of data points. N must be unchanged from the previous call of E01EAF.
Constraint: N3.
3:     XN – REAL (KIND=nag_wp) arrayInput
4:     YN – REAL (KIND=nag_wp) arrayInput
On entry: the coordinates of the rth data point, xr,yr, for r=1,2,,n. X and Y must be unchanged from the previous call of E01EAF.
5:     FN – REAL (KIND=nag_wp) arrayInput
On entry: the function values fr at xr,yr, for r=1,2,,n.
6:     TRIANG7×N – 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:     PXM – REAL (KIND=nag_wp) arrayInput
8:     PYM – REAL (KIND=nag_wp) arrayInput
On entry: the coordinates pxi,pyi, for i=1,2,,m, at which interpolated function values are sought.
9:     PFM – REAL (KIND=nag_wp) arrayOutput
On exit: the interpolated values Fpxi,pyi, for i=1,2,,m.
10:   IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. 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 -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is 0. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.
On exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6  Error Indicators and Warnings

If on entry IFAIL=0 or -1, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
IFAIL=1
On entry, N=value.
Constraint: N3.
IFAIL=2
On entry, M=value.
Constraint: M1.
IFAIL=3
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.
IFAIL=4
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.
IFAIL=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.8 in the Essential Introduction for further information.
IFAIL=-399
Your licence key may have expired or may not have been installed correctly.
See Section 3.7 in the Essential Introduction for further information.
IFAIL=-999
Dynamic memory allocation failed.
See Section 3.6 in the Essential Introduction for further information.

7  Accuracy

Not applicable.

8  Parallelism and Performance

Not applicable.

9  Further Comments

The time taken for a call of E01EBF is approximately proportional to the number of interpolation points, m.

10  Example

See Section 10 in E01EAF.

E01EBF (PDF version)
E01 Chapter Contents
E01 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2015