nag_2d_spline_ts_eval_rect (e02jfc) (PDF version)
e02 Chapter Contents
e02 Chapter Introduction
NAG Library Manual

NAG Library Function Document

nag_2d_spline_ts_eval_rect (e02jfc)

+ Contents

    1  Purpose
    7  Accuracy
    10  Example

1  Purpose

nag_2d_spline_ts_eval_rect (e02jfc) calculates a mesh of values of a spline computed by nag_2d_spline_fit_ts_scat (e02jdc).

2  Specification

#include <nag.h>
#include <nage02.h>
void  nag_2d_spline_ts_eval_rect (Integer nxeval, Integer nyeval, const double xevalm[], const double yevalm[], const double coefs[], double fevalm[], const Integer iopts[], const double opts[], NagError *fail)

3  Description

nag_2d_spline_ts_eval_rect (e02jfc) calculates values on a rectangular mesh of a bivariate spline computed by nag_2d_spline_fit_ts_scat (e02jdc). The points in the mesh are defined by x coordinates (xi), for i=1,2,,nx, and y coordinates (yj), for j=1,2,,ny. This function 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  Arguments

1:     nxevalIntegerInput
On entry: nx, the number of values in the x direction forming the mesh on which the spline is to be evaluated.
Constraint: nxeval1.
2:     nyevalIntegerInput
On entry: ny, the number of values in the y direction forming the mesh on which the spline is to be evaluated.
Constraint: nyeval1.
3:     xevalm[nxeval]const doubleInput
On entry: the xi values forming the mesh on which the spline is to be evaluated.
Constraint: for all i, xevalm[i-1] must lie inside, or on the boundary of, the spline's bounding box as determined by nag_2d_spline_fit_ts_scat (e02jdc).
4:     yevalm[nyeval]const doubleInput
On entry: the yj values forming the mesh on which the spline is to be evaluated.
Constraint: for all j, yevalm[j-1] must lie inside, or on the boundary of, the spline's bounding box as determined by nag_2d_spline_fit_ts_scat (e02jdc).
5:     coefs[dim]const doubleCommunication Array
Note: the dimension, 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 nag_2d_spline_fit_ts_scat (e02jdc).
On entry: the computed spline coefficients as output from nag_2d_spline_fit_ts_scat (e02jdc).
6:     fevalm[nxeval×nyeval]doubleOutput
Note: the i,jth element of the matrix is stored in fevalm[j-1×nxeval+i-1].
On exit: if fail.code= NE_NOERROR on exit fevalm[j-1×nxeval+i-1] contains the computed spline value at xi,yj.
7:     iopts[dim]const IntegerCommunication Array
Note: the dimension, 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 nag_fit_opt_set (e02zkc).
On entry: the contents of the array MUST NOT have been modified either directly or indirectly, by a call to nag_fit_opt_set (e02zkc), between calls to nag_2d_spline_fit_ts_scat (e02jdc) and nag_2d_spline_ts_eval_rect (e02jfc).
8:     opts[dim]const doubleCommunication Array
Note: the dimension, 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 nag_fit_opt_set (e02zkc).
On entry: the contents of the array MUST NOT have been modified either directly or indirectly, by a call to nag_fit_opt_set (e02zkc), between calls to nag_2d_spline_fit_ts_scat (e02jdc) and nag_2d_spline_ts_eval_rect (e02jfc).
9:     failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_INITIALIZATION
Option arrays are not initialized or are corrupted.
NE_INT
On entry, nxeval=value.
Constraint: nxeval1.
On entry, nyeval=value.
Constraint: nyeval1.
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.
NE_INVALID_SPLINE
The fitting routine has not been called, or the array of coefficients has been corrupted.
NE_POINT_OUTSIDE_RECT
On entry, xevalm[value]=value was outside the bounding box.
Constraint: valuexevalm[i-1]value for all i.
On entry, yevalm[value]=value was outside the bounding box.
Constraint: valueyevalm[j-1]value for all j.

7  Accuracy

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

8  Parallelism and Performance

nag_2d_spline_ts_eval_rect (e02jfc) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
Please consult the Users' Note for your implementation for any additional implementation-specific information.

9  Further Comments

A real array of length O1 is dynamically allocated by each invocation of nag_2d_spline_ts_eval_rect (e02jfc).

10  Example

See Section 10 in nag_2d_spline_fit_ts_scat (e02jdc).

nag_2d_spline_ts_eval_rect (e02jfc) (PDF version)
e02 Chapter Contents
e02 Chapter Introduction
NAG Library Manual

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