The routine may be called by the names e02def or nagf_fit_dim2_spline_evalv.
3Description
e02def 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 routine may be used to calculate values of a bicubic spline given in the form produced by e01daf,e02daf,e02dcfande02ddf. 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: – IntegerInput
3: – IntegerInput
On entry: px and py must specify the total number of knots associated with the variables and respectively. They are such that and are the corresponding numbers of interior knots.
Constraint:
and .
4: – Real (Kind=nag_wp) arrayInput
5: – Real (Kind=nag_wp) arrayInput
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.
Constraint:
and must satisfy
and
The spline representation is not valid outside these intervals
6: – Real (Kind=nag_wp) arrayInput
7: – Real (Kind=nag_wp) arrayInput
On entry: lamda and mu must contain the complete sets of knots and associated with the and variables respectively.
Constraint:
the knots in each set must be in nondecreasing order, with and .
8: – Real (Kind=nag_wp) arrayInput
On entry: must contain the coefficient described in Section 3, for and .
9: – Real (Kind=nag_wp) arrayOutput
On exit: contains the value of the spline at the point , for .
10: – Real (Kind=nag_wp) arrayWorkspace
11: – Integer arrayWorkspace
12: – IntegerInput/Output
On entry: ifail must be set to , or to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value or is recommended. If message printing is undesirable, then the value is recommended. Otherwise, the value is recommended. When the value or is used it is essential to test the value of ifail on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
6Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, the knots in lamda are not in nondecreasing order.
On entry, the knots in mu are not in nondecreasing order.
On entry, point lies outside the rectangle bounded by , , , : , and .
An unexpected error has been triggered by this routine. Please
contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.
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.
e02def 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.