# NAG CL Interfacee02jec (dim2_​spline_​ts_​evalv)

Settings help

CL Name Style:

## 1Purpose

e02jec calculates a vector of values of a spline computed by e02jdc.

## 2Specification

 #include
 void e02jec (Integer nevalv, const double xevalv[], const double yevalv[], const double coefs[], double fevalv[], const Integer iopts[], const double opts[], NagError *fail)
The function may be called by the names: e02jec, nag_fit_dim2_spline_ts_evalv or nag_2d_spline_ts_eval.

## 3Description

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

## 4References

Davydov O, Morandi R and Sestini A (2006) Local hybrid approximation for scattered data fitting with bivariate splines Comput. Aided Geom. Design 23 703–721
Davydov O, Sestini A and Morandi R (2005) Local RBF approximation for scattered data fitting with bivariate splines Trends and Applications in Constructive Approximation M. G. de Bruin, D. H. Mache, and J. Szabados, Eds ISNM Vol. 151 Birkhauser 91–102
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.

## 5Arguments

1: $\mathbf{nevalv}$Integer Input
On entry: $n$, the number of values at which the spline is to be evaluated.
Constraint: ${\mathbf{nevalv}}\ge 1$.
2: $\mathbf{xevalv}\left[{\mathbf{nevalv}}\right]$const double Input
On entry: the $\left({x}_{i}\right)$ values at which the spline is to be evaluated.
Constraint: for all $i$, ${\mathbf{xevalv}}\left[i-1\right]$ must lie inside, or on the boundary of, the spline's bounding box as determined by e02jdc.
3: $\mathbf{yevalv}\left[{\mathbf{nevalv}}\right]$const double Input
On entry: the $\left({y}_{i}\right)$ values at which the spline is to be evaluated.
Constraint: for all $i$, ${\mathbf{yevalv}}\left[i-1\right]$ must lie inside, or on the boundary of, the spline's bounding box as determined by e02jdc.
4: $\mathbf{coefs}\left[\mathit{dim}\right]$const double Communication Array
Note: the dimension, $\mathit{dim}$, of this array is dictated by the requirements of associated functions that must have been previously called. This array MUST be the same array passed as argument coefs in the previous call to e02jdc.
On entry: the computed spline coefficients as output from e02jdc.
5: $\mathbf{fevalv}\left[{\mathbf{nevalv}}\right]$double Output
On exit: if ${\mathbf{fail}}\mathbf{.}\mathbf{code}=$ NE_NOERROR on exit ${\mathbf{fevalv}}\left[i-1\right]$ contains the computed spline value at $\left({x}_{i},{y}_{i}\right)$.
6: $\mathbf{iopts}\left[\mathit{dim}\right]$const Integer Communication Array
Note: the dimension, $\mathit{dim}$, of this array is dictated by the requirements of associated functions that must have been previously called. This array MUST be the same array passed as argument iopts in the previous call to e02zkc.
On entry: the contents of the array MUST NOT have been modified either directly or indirectly, by a call to e02zkc, between calls to e02jdc and e02jec.
7: $\mathbf{opts}\left[\mathit{dim}\right]$const double Communication Array
Note: the dimension, $\mathit{dim}$, of this array is dictated by the requirements of associated functions that must have been previously called. This array MUST be the same array passed as argument opts in the previous call to e02zkc.
On entry: the contents of the array MUST NOT have been modified either directly or indirectly, by a call to e02zkc, between calls to e02jdc and e02jec.
8: $\mathbf{fail}$NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

## 6Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
On entry, argument $⟨\mathit{\text{value}}⟩$ had an illegal value.
NE_INITIALIZATION
Option arrays are not initialized or are corrupted.
NE_INT
On entry, ${\mathbf{nevalv}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{nevalv}}\ge 1$.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_INVALID_SPLINE
The fitting routine has not been called, or the array of coefficients has been corrupted.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.
NE_POINT_OUTSIDE_RECT
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-1\right]\le ⟨\mathit{\text{value}}⟩$ for all $i$.
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-1\right]\le ⟨\mathit{\text{value}}⟩$ for all $i$.

## 7Accuracy

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

## 8Parallelism and Performance

e02jec is not threaded in any implementation.

To evaluate a ${C}^{1}$ approximation (i.e., when ${\mathbf{Global Smoothing Level}}=1$), a real array of length $\mathit{O}\left(1\right)$ is dynamically allocated by each invocation of e02jec. No memory is allocated internally when evaluating a ${C}^{2}$ approximation.