The function may be called by the names: e02dec, nag_fit_dim2_spline_evalv or nag_2d_spline_eval.
3Description
e02dec calculates values of the bicubic spline at prescribed points , for , from its augmented knot sets and and from the coefficients , for and , in its B-spline representation
Here and denote normalized cubic B-splines, the former defined on the knots to and the latter on the knots to .
This function may be used to calculate values of a bicubic spline given in the form produced by e01dac, e02dcc and e02ddc. It is derived from the routine B2VRE in Anthony et al. (1982).
4References
Anthony G T, Cox M G and Hayes J G (1982) DASL – Data Approximation Subroutine Library National Physical Laboratory
Cox M G (1978) The numerical evaluation of a spline from its B-spline representation J. Inst. Math. Appl.21 135–143
5Arguments
1: – IntegerInput
On entry: , the number of points at which values of the spline are required.
Constraint:
.
2: – const doubleInput
3: – const doubleInput
On entry: x and y must contain and , for , respectively. These are the coordinates of the points at which values of the spline are required. The order of the points is immaterial.
and .
The spline representation is not valid outside these intervals, for .
4: – doubleOutput
On exit: contains the value of the spline at the point , for .
5: – Nag_2dSpline *
Pointer to structure of type Nag_2dSpline with the following members:
nx – IntegerInput
On entry: must specify the total number of knots associated with the variables . It is such that is the number of interior knots.
Constraint:
.
lamda – double *Input
On entry: a pointer to which memory of size must be allocated. must contain the complete sets of knots associated with the variable.
Constraint:
the knots must be in nondecreasing order, with .
ny – IntegerInput
On entry: must specify the total number of knots associated with the variable .
It is such that is the number of interior knots.
Constraint:
.
mu – double *Input
On entry: a pointer to which memory of size must be allocated. must contain the complete sets of knots associated with the variable.
Constraint:
the knots must be in nondecreasing order, with .
c – double *Input
On entry: a pointer to which memory of size must be allocated. must contain the coefficient described in Section 3, for and .
In normal usage, the call to e02dec follows a call to e01dac, e02dcc or e02ddc, in which case, members of the structure spline will have been set up correctly for input to e02dec.
6: – 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.
NE_END_KNOTS_CONS
On entry, the end knots must satisfy , , .
NE_INT_ARG_LT
On entry, .
Constraint: .
On entry, must not be less than 8: .
On entry, must not be less than 8: .
NE_NOT_INCREASING
The sequence is not increasing: , .
The sequence is not increasing: , .
NE_POINT_OUTSIDE_RECT
On entry, point lies outside the rectangle bounded by , , , .
7Accuracy
The method used to evaluate the B-splines is numerically stable, in the sense that each computed value of can be regarded as the value that would have been obtained in exact arithmetic from slightly perturbed B-spline coefficients. See Cox (1978) for details.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
e02dec is not threaded in any implementation.
9Further Comments
Computation time is approximately proportional to the number of points, , at which the evaluation is required.
10Example
This program reads in knot sets and , and a set of bicubic spline coefficients . Following these are a value for and the coordinates , for , at which the spline is to be evaluated.