NAG FL Interface
e02dff (dim2_spline_evalm)
1
Purpose
e02dff calculates values of a bicubic spline from its B-spline representation. The spline is evaluated at all points on a rectangular grid.
2
Specification
Fortran Interface
Subroutine e02dff ( |
mx, my, px, py, x, y, lamda, mu, c, ff, wrk, lwrk, iwrk, liwrk, ifail) |
Integer, Intent (In) |
:: |
mx, my, px, py, lwrk, liwrk |
Integer, Intent (Inout) |
:: |
ifail |
Integer, Intent (Out) |
:: |
iwrk(liwrk) |
Real (Kind=nag_wp), Intent (In) |
:: |
x(mx), y(my), lamda(px), mu(py), c((px-4)*(py-4)) |
Real (Kind=nag_wp), Intent (Out) |
:: |
ff(mx*my), wrk(lwrk) |
|
C Header Interface
#include <nag.h>
void |
e02dff_ (const Integer *mx, const Integer *my, const Integer *px, const Integer *py, const double x[], const double y[], const double lamda[], const double mu[], const double c[], double ff[], double wrk[], const Integer *lwrk, Integer iwrk[], const Integer *liwrk, Integer *ifail) |
|
C++ Header Interface
#include <nag.h> extern "C" {
void |
e02dff_ (const Integer &mx, const Integer &my, const Integer &px, const Integer &py, const double x[], const double y[], const double lamda[], const double mu[], const double c[], double ff[], double wrk[], const Integer &lwrk, Integer iwrk[], const Integer &liwrk, Integer &ifail) |
}
|
The routine may be called by the names e02dff or nagf_fit_dim2_spline_evalm.
3
Description
e02dff calculates values of the bicubic spline
on a rectangular grid of points in the
-
plane, 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 .
The points in the grid are defined by coordinates , for , along the axis, and coordinates , for , along the axis.
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
Arguments
-
1:
– Integer
Input
-
2:
– Integer
Input
-
On entry:
mx and
my must specify
and
respectively, the number of points along the
and
axis that define the rectangular grid.
Constraint:
and .
-
3:
– Integer
Input
-
4:
– Integer
Input
-
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 .
-
5:
– Real (Kind=nag_wp) array
Input
-
6:
– Real (Kind=nag_wp) array
Input
-
On entry:
x and
y must contain
, for
, and
, for
, respectively. These are the
and
coordinates that define the rectangular grid of points at which values of the spline are required.
Constraint:
and
y must satisfy
and
.
The spline representation is not valid outside these intervals.
-
7:
– Real (Kind=nag_wp) array
Input
-
8:
– Real (Kind=nag_wp) array
Input
-
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 .
-
9:
– Real (Kind=nag_wp) array
Input
-
On entry:
must contain the coefficient
described in
Section 3, for
and
.
-
10:
– Real (Kind=nag_wp) array
Output
-
On exit: contains the value of the spline at the point , for and .
-
11:
– Real (Kind=nag_wp) array
Workspace
-
12:
– Integer
Input
-
On entry: the dimension of the array
wrk as declared in the (sub)program from which
e02dff is called.
Constraint:
.
-
13:
– Integer array
Workspace
-
14:
– Integer
Input
-
On entry: the dimension of the array
iwrk as declared in the (sub)program from which
e02dff is called.
Constraints:
- if , ;
- otherwise .
-
15:
– Integer
Input/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).
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, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
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, is violated.
On entry, is violated.
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.
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.
8
Parallelism and Performance
e02dff is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
Computation time is approximately proportional to .
10
Example
This example reads in knot sets and , and a set of bicubic spline coefficients . Following these are values for and the coordinates , for , and values for and the coordinates , for , defining the grid of points on which the spline is to be evaluated.
10.1
Program Text
10.2
Program Data
10.3
Program Results