A set of
data points with rectangular Cartesian coordinates
are sorted into panels defined by lines parallel to the
and
axes. The intercepts of these lines on the
and
axes are given in
, for
and
, for
, respectively. The subroutine orders the data so that all points in a panel occur before data in succeeding panels, where the panels are numbered from bottom to top and then left to right, with the usual arrangement of axes, as shown in the diagram. Within a panel the points maintain their original order.
A data point lying exactly on one or more panel sides is taken to be in the highest-numbered panel adjacent to the point. The subroutine does not physically rearrange the data, but provides the array
point which contains a linked list for each panel, pointing to the data in that panel. The total number of panels is
.
None.
-
1:
– Integer
Input
-
2:
– Integer
Input
-
On entry:
px and
py must specify eight more than the number of intercepts on the
axis and
axis, respectively.
Constraint:
and .
-
3:
– Real (Kind=nag_wp) array
Input
-
On entry: to must contain, in nondecreasing order, the intercepts on the axis of the sides of the panels parallel to the axis.
-
4:
– Real (Kind=nag_wp) array
Input
-
On entry: to must contain, in nondecreasing order, the intercepts on the axis of the sides of the panels parallel to the axis.
-
5:
– Integer
Input
-
On entry: the number of data points.
-
6:
– Real (Kind=nag_wp) array
Input
-
7:
– Real (Kind=nag_wp) array
Input
-
On entry: the coordinates of the
th data point , for .
-
8:
– Integer array
Output
-
On exit: for
,
is the index of the first point in panel
,
is the index of the second point in panel
and so on.
indicates that was the last point in the panel.
The coordinates of points in panel
can be accessed in turn by means of the following
instructions:
in = m + i
10 in = point(in)
If (in.eq. 0) Goto 20
xi = x(in)
yi = y(in)
.
.
.
Goto 10
20 ...
-
9:
– Integer
Input
-
On entry: the dimension of the array
point as declared in the (sub)program from which
e02zaf is called.
Constraint:
.
-
10:
– Integer array
Workspace
-
11:
– Integer
Input
-
On entry: the value , the number of panels into which the plane is divided.
-
12:
– 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).
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
Not applicable.
This subroutine was written to sort two-dimensional data in the manner required by routine
e02daf. The first
arguments of
e02zaf are the same as the arguments in
e02daf which have the same name.
This example reads in data points and the intercepts of the panel sides on the
and
axes; it calls
e02zaf to set up the index array
point; and finally it prints the data points in panel order.