E02JEF (PDF version)
E02 Chapter Contents
E02 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentE02JEF

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.

## 1  Purpose

E02JEF calculates a vector of values of a spline computed by E02JDF.

## 2  Specification

 SUBROUTINE E02JEF ( NEVALV, XEVALV, YEVALV, COEFS, FEVALV, IOPTS, OPTS, IFAIL)
 INTEGER NEVALV, IOPTS(*), IFAIL REAL (KIND=nag_wp) XEVALV(NEVALV), YEVALV(NEVALV), COEFS(*), FEVALV(NEVALV), OPTS(*)

## 3  Description

E02JEF calculates values at prescribed points (${x}_{i}$,${y}_{i}$), for $\mathit{i}=1,2,\dots ,n$, of a bivariate spline computed by E02JDF. It is derived from the TSFIT package of O. Davydov and F. Zeilfelder.

## 4  References

Davydov O and Zeilfelder F (2004) Scattered data fitting by direct extension of local polynomials to bivariate splines Advances in Comp. Math. 21 223–271
Farin G and Hansford D (2000) The Essentials of CAGD Natic, MA: A K Peters, Ltd.

## 5  Parameters

1:     NEVALV – INTEGERInput
On entry: $n$, the number of values at which the spline is to be evaluated.
Constraint: ${\mathbf{NEVALV}}\ge 1$.
2:     XEVALV(NEVALV) – REAL (KIND=nag_wp) arrayInput
On entry: the $\left({x}_{i}\right)$ values at which the spline is to be evaluated.
Constraint: for all $i$, ${\mathbf{XEVALV}}\left(i\right)$ must lie inside, or on the boundary of, the spline's bounding box as determined by E02JDF.
3:     YEVALV(NEVALV) – REAL (KIND=nag_wp) arrayInput
On entry: the $\left({y}_{i}\right)$ values at which the spline is to be evaluated.
Constraint: for all $i$, ${\mathbf{YEVALV}}\left(i\right)$ must lie inside, or on the boundary of, the spline's bounding box as determined by E02JDF.
4:     COEFS($*$) – REAL (KIND=nag_wp) arrayInput
On entry: the computed spline coefficients COEFS as output from E02JDF.
5:     FEVALV(NEVALV) – REAL (KIND=nag_wp) arrayOutput
On exit: if ${\mathbf{IFAIL}}={\mathbf{0}}$ on exit ${\mathbf{FEVALV}}\left(i\right)$ contains the computed spline value at $\left({x}_{i},{y}_{i}\right)$.
6:     IOPTS($*$) – INTEGER arrayCommunication Array
On entry: must be the same array IOPTS supplied in a previous call to E02JDF. The contents of the array must not have been modified either directly or indirectly, by a call to E02ZKF, between calls to E02JDF and E02JEF.
7:     OPTS($*$) – REAL (KIND=nag_wp) arrayCommunication Array
On entry: must be the same array OPTS supplied in a previous call to E02JDF. The contents of the array must not have been modified either directly or indirectly, by a call to E02ZKF, between calls to E02JDF and E02JEF.
8:     IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to $0$, $-1\text{​ 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\text{​ 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 $-\mathbf{1}\text{​ or ​}\mathbf{1}$ is used it is essential to test the value of IFAIL on exit.
On exit: ${\mathbf{IFAIL}}={\mathbf{0}}$ unless the routine detects an error or a warning has been flagged (see Section 6).

## 6  Error Indicators and Warnings

If on entry ${\mathbf{IFAIL}}={\mathbf{0}}$ or $-{\mathbf{1}}$, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
${\mathbf{IFAIL}}=2$
On entry, ${\mathbf{NEVALV}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{NEVALV}}\ge 1$.
${\mathbf{IFAIL}}=9$
Option arrays are not initialized or are corrupted.
${\mathbf{IFAIL}}=10$
The fitting routine has not been called, or the array of coefficients has been corrupted.
${\mathbf{IFAIL}}=13$
On entry, ${\mathbf{XEVALV}}\left(⟨\mathit{\text{value}}⟩\right)=⟨\mathit{\text{value}}⟩$ was outside the bounding box.
Constraint: $⟨\mathit{\text{value}}⟩\le {\mathbf{XEVALV}}\left(i\right)\le ⟨\mathit{\text{value}}⟩$ for all $i$.
${\mathbf{IFAIL}}=14$
On entry, ${\mathbf{YEVALV}}\left(⟨\mathit{\text{value}}⟩\right)=⟨\mathit{\text{value}}⟩$ was outside the bounding box.
Constraint: $⟨\mathit{\text{value}}⟩\le {\mathbf{YEVALV}}\left(i\right)\le ⟨\mathit{\text{value}}⟩$ for all $i$.
${\mathbf{IFAIL}}=-999$
Dynamic memory allocation failed.

## 7  Accuracy

E02JEF uses the de Casteljau algorithm and thus is numerically stable. See Farin and Hansford (2000) for details.

## 8  Further Comments

A real array of length $\mathit{O}\left(1\right)$ is dynamically allocated by each invocation of E02JEF.

## 9  Example

See Section 9 in E02JDF.

E02JEF (PDF version)
E02 Chapter Contents
E02 Chapter Introduction
NAG Library Manual