e02de calculates values of a bicubic spline from its B-spline representation.

Syntax

C#
public static void e02de(
	int m,
	int px,
	int py,
	double[] x,
	double[] y,
	double[] lamda,
	double[] mu,
	double[] c,
	double[] ff,
	out int ifail
)
Visual Basic
Public Shared Sub e02de ( _
	m As Integer, _
	px As Integer, _
	py As Integer, _
	x As Double(), _
	y As Double(), _
	lamda As Double(), _
	mu As Double(), _
	c As Double(), _
	ff As Double(), _
	<OutAttribute> ByRef ifail As Integer _
)
Visual C++
public:
static void e02de(
	int m, 
	int px, 
	int py, 
	array<double>^ x, 
	array<double>^ y, 
	array<double>^ lamda, 
	array<double>^ mu, 
	array<double>^ c, 
	array<double>^ ff, 
	[OutAttribute] int% ifail
)
F#
static member e02de : 
        m : int * 
        px : int * 
        py : int * 
        x : float[] * 
        y : float[] * 
        lamda : float[] * 
        mu : float[] * 
        c : float[] * 
        ff : float[] * 
        ifail : int byref -> unit 

Parameters

m
Type: System..::..Int32
On entry: m, the number of points at which values of the spline are required.
Constraint: m1.
px
Type: System..::..Int32
On entry: px and py must specify the total number of knots associated with the variables x and y respectively. They are such that px-8 and py-8 are the corresponding numbers of interior knots.
Constraint: px8 and py8.
py
Type: System..::..Int32
On entry: px and py must specify the total number of knots associated with the variables x and y respectively. They are such that px-8 and py-8 are the corresponding numbers of interior knots.
Constraint: px8 and py8.
x
Type: array<System..::..Double>[]()[][]
An array of size [m]
On entry: x and y must contain xr and yr, for r=1,2,,m, respectively. These are the coordinates of the points at which values of the spline are required. The order of the points is immaterial.
Constraint: x and y must satisfy
lamda[3]x[r-1]lamda[px-4]
and
mu[3]y[r-1]mu[py-4],  r=1,2,,m.
.
The spline representation is not valid outside these intervals.
y
Type: array<System..::..Double>[]()[][]
An array of size [m]
On entry: x and y must contain xr and yr, for r=1,2,,m, respectively. These are the coordinates of the points at which values of the spline are required. The order of the points is immaterial.
Constraint: x and y must satisfy
lamda[3]x[r-1]lamda[px-4]
and
mu[3]y[r-1]mu[py-4],  r=1,2,,m.
.
The spline representation is not valid outside these intervals.
lamda
Type: array<System..::..Double>[]()[][]
An array of size [px]
On entry: lamda and mu must contain the complete sets of knots λ and μ associated with the x and y variables respectively.
Constraint: the knots in each set must be in nondecreasing order, with lamda[px-4]>lamda[3] and mu[py-4]>mu[3].
mu
Type: array<System..::..Double>[]()[][]
An array of size [px]
On entry: lamda and mu must contain the complete sets of knots λ and μ associated with the x and y variables respectively.
Constraint: the knots in each set must be in nondecreasing order, with lamda[px-4]>lamda[3] and mu[py-4]>mu[3].
c
Type: array<System..::..Double>[]()[][]
An array of size [px-4×py-4]
On entry: c[py-4×i-1+j-1] must contain the coefficient cij described in [Description], for i=1,2,,px-4 and j=1,2,,py-4.
ff
Type: array<System..::..Double>[]()[][]
An array of size [m]
On exit: ff[r-1] contains the value of the spline at the point xr,yr, for r=1,2,,m.
ifail
Type: System..::..Int32%
On exit: ifail=0 unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

Description

e02de calculates values of the bicubic spline sx,y at prescribed points xr,yr, for r=1,2,,m, from its augmented knot sets λ and μ and from the coefficients cij, for i=1,2,,px-4 and j=1,2,,py-4, in its B-spline representation
sx,y=ijcijMixNjy.
Here Mix and Njy denote normalized cubic B-splines, the former defined on the knots λi to λi+4 and the latter on the knots μj to μj+4.
This method may be used to calculate values of a bicubic spline given in the form produced by e01da (E02DAF not in this release) (E02DCF not in this release) (E02DDF not in this release). It is derived from the method B2VRE in Anthony et al. (1982).

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

Error Indicators and Warnings

Errors or warnings detected by the method:
ifail=1
On entry,m<1,
orpy<8,
orpx<8.
ifail=2
On entry, the knots in array lamda, or those in array mu, are not in nondecreasing order, or lamda[px-4]lamda[3], or mu[py-4]mu[3].
ifail=3
On entry, at least one of the prescribed points xr,yr lies outside the rectangle defined by lamda[3], lamda[px-4] and mu[3], mu[py-4].
ifail=-9000
An error occured, see message report.
ifail=-8000
Negative dimension for array value
ifail=-6000
Invalid Parameters value

Accuracy

The method used to evaluate the B-splines is numerically stable, in the sense that each computed value of sxr,yr 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.

Parallelism and Performance

None.

Further Comments

Computation time is approximately proportional to the number of points, m, at which the evaluation is required.

Example

This program reads in knot sets lamda[0],,lamda[px-1] and mu[0],,mu[py-1], and a set of bicubic spline coefficients cij. Following these are a value for m and the coordinates xr,yr, for r=1,2,,m, at which the spline is to be evaluated.

Example program (C#): e02dee.cs

Example program data: e02dee.d

Example program results: e02dee.r

See Also