NAG Library Routine Document
E02DEF
1 Purpose
E02DEF calculates values of a bicubic spline from its B-spline representation.
2 Specification
SUBROUTINE E02DEF ( |
M, PX, PY, X, Y, LAMDA, MU, C, FF, WRK, IWRK, IFAIL) |
INTEGER |
M, PX, PY, IWRK(PY-4), IFAIL |
REAL (KIND=nag_wp) |
X(M), Y(M), LAMDA(PX), MU(PY), C((PX-4)*(PY-4)), FF(M), WRK(PY-4) |
|
3 Description
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,
E02DCF and
E02DDF. It is derived from the routine B2VRE in
Anthony et al. (1982).
4 References
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
5 Parameters
- 1: M – INTEGERInput
On entry: , the number of points at which values of the spline are required.
Constraint:
.
- 2: PX – INTEGERInput
- 3: PY – 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: X(M) – REAL (KIND=nag_wp) arrayInput
- 5: Y(M) – 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: LAMDA(PX) – REAL (KIND=nag_wp) arrayInput
- 7: MU(PY) – 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: C() – REAL (KIND=nag_wp) arrayInput
On entry:
must contain the coefficient
described in
Section 3, for
and
.
- 9: FF(M) – REAL (KIND=nag_wp) arrayOutput
On exit: contains the value of the spline at the point , for .
- 10: WRK() – REAL (KIND=nag_wp) arrayWorkspace
- 11: IWRK() – INTEGER arrayWorkspace
- 12: IFAIL – INTEGERInput/Output
-
On entry:
IFAIL must be set to
,
. 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
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
.
When the value 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).
6 Error 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, | , |
or | , |
or | . |
On entry, the knots in array
LAMDA, or those in array
MU, are not in nondecreasing order, or
, or
.
On entry, at least one of the prescribed points lies outside the rectangle defined by , and , .
7 Accuracy
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.
Computation time is approximately proportional to the number of points, , at which the evaluation is required.
9 Example
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.
9.1 Program Text
Program Text (e02defe.f90)
9.2 Program Data
Program Data (e02defe.d)
9.3 Program Results
Program Results (e02defe.r)