NAG FL Interface
e02dhf (dim2_spline_derivm)
1
Purpose
e02dhf computes the partial derivative (of order
,
), of a bicubic spline approximation to a set of data values, from its B-spline representation, at points on a rectangular grid in the
-
plane. This routine may be used to calculate derivatives of a bicubic spline given in the form produced by
e01daf,
e02daf,
e02dcf and
e02ddf.
2
Specification
Fortran Interface
Subroutine e02dhf ( |
mx, my, px, py, x, y, lamda, mu, c, nux, nuy, z, ifail) |
Integer, Intent (In) |
:: |
mx, my, px, py, nux, nuy |
Integer, Intent (Inout) |
:: |
ifail |
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) |
:: |
z(mx*my) |
|
C Header Interface
#include <nag.h>
void |
e02dhf_ (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[], const Integer *nux, const Integer *nuy, double z[], Integer *ifail) |
|
C++ Header Interface
#include <nag.h> extern "C" {
void |
e02dhf_ (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[], const Integer &nux, const Integer &nuy, double z[], Integer &ifail) |
}
|
The routine may be called by the names e02dhf or nagf_fit_dim2_spline_derivm.
3
Description
e02dhf determines the partial derivative of a smooth bicubic spline approximation at the set of data points .
The spline is given in the B-spline representation
where
and
denote normalized cubic B-splines, the former defined on the knots
to
and the latter on the knots
to
, with
and
the total numbers of knots of the computed spline with respect to the
and
variables respectively. For further details, see
Hayes and Halliday (1974) for bicubic splines and
de Boor (1972) for normalized B-splines. This routine is suitable for B-spline representations returned by
e01daf,
e02daf,
e02dcf and
e02ddf.
The partial derivatives can be up to order in each direction; thus the highest mixed derivative available is .
The points in the grid are defined by coordinates , for , along the axis, and coordinates , for , along the axis.
4
References
de Boor C (1972) On calculating with B-splines J. Approx. Theory 6 50–62
Dierckx P (1981) An improved algorithm for curve fitting with spline functions Report TW54 Department of Computer Science, Katholieke Univerciteit Leuven
Dierckx P (1982) A fast algorithm for smoothing data on a rectangular grid while using spline functions SIAM J. Numer. Anal. 19 1286–1304
Hayes J G and Halliday J (1974) The least squares fitting of cubic spline surfaces to general data sets J. Inst. Math. Appl. 14 89–103
Reinsch C H (1967) Smoothing by spline functions Numer. Math. 10 177–183
5
Arguments
-
1:
– Integer
Input
-
On entry: , the number of grid points along the axis.
Constraint:
.
-
2:
– Integer
Input
-
On entry: , the number of grid points along the axis.
Constraint:
.
-
3:
– Integer
Input
-
On entry: the total number of knots in the
-direction of the bicubic spline approximation, e.g., the value
nx as returned by
e02dcf.
-
4:
– Integer
Input
-
On entry: the total number of knots in the
-direction of the bicubic spline approximation, e.g., the value
ny as returned by
e02dcf.
-
5:
– Real (Kind=nag_wp) array
Input
-
On entry: must be set to
, the coordinate of the th grid point along the axis, for , on which values of the partial derivative are sought.
Constraint:
.
-
6:
– Real (Kind=nag_wp) array
Input
-
On entry: must be set to , the coordinate of the th grid point along the axis, for on which values of the partial derivative are sought.
Constraint:
.
-
7:
– Real (Kind=nag_wp) array
Input
-
On entry: contains the position of the knots in the
-direction of the bicubic spline approximation to be differentiated, e.g.,
lamda as returned by
e02dcf.
-
8:
– Real (Kind=nag_wp) array
Input
-
On entry: contains the position of the knots in the
-direction of the bicubic spline approximation to be differentiated, e.g.,
mu as returned by
e02dcf.
-
9:
– Real (Kind=nag_wp) array
Input
-
On entry: the coefficients of the bicubic spline approximation to be differentiated, e.g.,
c as returned by
e02dcf.
-
10:
– Integer
Input
-
On entry: specifies the order, of the partial derivative in the -direction.
Constraint:
.
-
11:
– Integer
Input
-
On entry: specifies the order, of the partial derivative in the -direction.
Constraint:
.
-
12:
– Real (Kind=nag_wp) array
Output
-
On exit: contains the derivative , for and .
-
13:
– 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, for , and .
Constraint: , for .
-
On entry, for , and .
Constraint: , for .
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
On successful exit, the partial derivatives on the given mesh are accurate to
machine precision with respect to the supplied bicubic spline. Please refer to Section 7 in
e01daf,
e02daf,
e02dcf and
e02ddf of the routine document for the respective routine which calculated the spline approximant for details on the accuracy of that approximation.
8
Parallelism and Performance
e02dhf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
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.
None.
10
Example
This example reads in values of
,
,
, for
, and
, for
, followed by values of the ordinates
defined at the grid points
. It then calls
e02dcf to compute a bicubic spline approximation for one specified value of
. Finally it evaluates the spline and its first
derivative at a small sample of points on a rectangular grid by calling
e02dhf.
10.1
Program Text
10.2
Program Data
10.3
Program Results