e02df calculates values of a bicubic spline from its B-spline representation. The spline is evaluated at all points on a rectangular grid.

Syntax

C#
public static void e02df(
	int mx,
	int my,
	int px,
	int py,
	double[] x,
	double[] y,
	double[] lamda,
	double[] mu,
	double[] c,
	double[] ff,
	out int ifail
)
Visual Basic
Public Shared Sub e02df ( _
	mx As Integer, _
	my 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 e02df(
	int mx, 
	int my, 
	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 e02df : 
        mx : int * 
        my : int * 
        px : int * 
        py : int * 
        x : float[] * 
        y : float[] * 
        lamda : float[] * 
        mu : float[] * 
        c : float[] * 
        ff : float[] * 
        ifail : int byref -> unit 

Parameters

mx
Type: System..::..Int32
On entry: mx and my must specify mx and my respectively, the number of points along the x and y axis that define the rectangular grid.
Constraint: mx1 and my1.
my
Type: System..::..Int32
On entry: mx and my must specify mx and my respectively, the number of points along the x and y axis that define the rectangular grid.
Constraint: mx1 and my1.
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 [mx]
On entry: x and y must contain xq, for q=1,2,,mx, and yr, for r=1,2,,my, respectively. These are the x and y coordinates that define the rectangular grid of points at which values of the spline are required.
Constraint: x and y must satisfy
lamda[3]x[q-1]<x[q]lamda[px-4],  q=1,2,,mx-1
and
mu[3]y[r-1]<y[r]mu[py-4],  r=1,2,,my-1.
.
The spline representation is not valid outside these intervals.
y
Type: array<System..::..Double>[]()[][]
An array of size [mx]
On entry: x and y must contain xq, for q=1,2,,mx, and yr, for r=1,2,,my, respectively. These are the x and y coordinates that define the rectangular grid of points at which values of the spline are required.
Constraint: x and y must satisfy
lamda[3]x[q-1]<x[q]lamda[px-4],  q=1,2,,mx-1
and
mu[3]y[r-1]<y[r]mu[py-4],  r=1,2,,my-1.
.
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 [mx×my]
On exit: ff[my×q-1+r-1] contains the value of the spline at the point xq,yr, for q=1,2,,mx and r=1,2,,my.
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

e02df calculates values of the bicubic spline sx,y on a rectangular grid of points in the x-y plane, 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.
The points in the grid are defined by coordinates xq, for q=1,2,,mx, along the x axis, and coordinates yr, for r=1,2,,my, along the y axis.
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,mx<1,
ormy<1,
orpy<8,
orpx<8.
ifail=2
On entry,lwrk is too small,
orliwrk is too small.
ifail=3
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=4
On entry, the restriction lamda[3]x[0]<<x[mx-1]lamda[px-4], or the restriction mu[3]y[0]<<y[my-1]mu[py-4], is violated.
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 mxmy+4mx+my.

Example

This example 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 values for mx and the x coordinates xq, for q=1,2,,mx, and values for my and the y coordinates yr, for r=1,2,,my, defining the grid of points on which the spline is to be evaluated.

Example program (C#): e02dfe.cs

Example program data: e02dfe.d

Example program results: e02dfe.r

See Also