NAG FL Interface
e02bdf (dim1_spline_integ)
1
Purpose
e02bdf computes the definite integral of a cubic spline from its B-spline representation.
2
Specification
Fortran Interface
Integer, Intent (In) |
:: |
ncap7 |
Integer, Intent (Inout) |
:: |
ifail |
Real (Kind=nag_wp), Intent (In) |
:: |
lamda(ncap7), c(ncap7) |
Real (Kind=nag_wp), Intent (Out) |
:: |
dint |
|
C Header Interface
#include <nag.h>
void |
e02bdf_ (const Integer *ncap7, const double lamda[], const double c[], double *dint, Integer *ifail) |
|
C++ Header Interface
#include <nag.h> extern "C" {
void |
e02bdf_ (const Integer &ncap7, const double lamda[], const double c[], double &dint, Integer &ifail) |
}
|
The routine may be called by the names e02bdf or nagf_fit_dim1_spline_integ.
3
Description
e02bdf computes the definite integral of the cubic spline
between the limits
and
, where
and
are respectively the lower and upper limits of the range over which
is defined. It is assumed that
is represented in terms of its B-spline coefficients
, for
and (augmented) ordered knot set
, for
, with
, for
and
, for
, (see
e02baf), i.e.,
Here
,
is the number of intervals of the spline and
denotes the normalized B-spline of degree
(order
) defined upon the knots
.
The method employed uses the formula given in Section 3 of
Cox (1975).
e02bdf can be used to determine the definite integrals of cubic spline fits and interpolants produced by
e02baf.
4
References
Cox M G (1975) An algorithm for spline interpolation J. Inst. Math. Appl. 15 95–108
5
Arguments
-
1:
– Integer
Input
-
On entry: , where is the number of intervals of the spline (which is one greater than the number of interior knots, i.e., the knots strictly within the range to ) over which the spline is defined.
Constraint:
.
-
2:
– Real (Kind=nag_wp) array
Input
-
On entry: must be set to the value of the th member of the complete set of knots, , for .
Constraint:
the must be in nondecreasing order with and satisfy and .
-
3:
– Real (Kind=nag_wp) array
Input
-
On entry: the coefficient
of the B-spline , for . The remaining elements of the array are not referenced.
-
4:
– Real (Kind=nag_wp)
Output
-
On exit: the value of the definite integral of between the limits and , where and .
-
5:
– 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, , and .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: .
On entry, , and .
Constraint: .
On entry, , and .
Constraint: .
On entry, , and .
Constraint: .
On entry, , and .
Constraint: .
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 rounding errors are such that the computed value of the integral is exact for a slightly perturbed set of B-spline coefficients differing in a relative sense from those supplied by no more than .
8
Parallelism and Performance
e02bdf is not threaded in any implementation.
The time taken is approximately proportional to .
10
Example
This example determines the definite integral over the interval of a cubic spline having interior knots at the positions , , , , , , the additional knots , , , , , , , , and the B-spline coefficients , , , , , , , , , .
The input data items (using the notation of
Section 5) comprise the following values in the order indicated:
|
|
, |
for |
, |
for |
10.1
Program Text
10.2
Program Data
10.3
Program Results