nag_2d_panel_sort (e02zac) sorts two-dimensional data into rectangular panels.
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 function 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.
Figure 1
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 function 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.
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_INT
-
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
- NE_INT_2
-
On entry, and .
Constraint: and .
- NE_INTERNAL_ERROR
-
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact
NAG for assistance.
- NE_NOT_NON_DECREASING
-
On entry, , and .
Constraint: .
On entry, , and .
Constraint: .
Not applicable.
Not applicable.
This function was written to sort two-dimensional data in the manner required by function
nag_2d_spline_fit_panel (e02dac). The first
arguments of nag_2d_panel_sort (e02zac) are the same as the arguments in
nag_2d_spline_fit_panel (e02dac) which have the same name.
This example reads in data points and the intercepts of the panel sides on the
and
axes; it calls nag_2d_panel_sort (e02zac) to set up the index array
point; and finally it prints the data points in panel order.