SSJ
3.2.1
Stochastic Simulation in Java
|
Implements a MultiDimSortComparable that performs a split sort on a MultiDimComparable<T> array based on its first \(d\) dimensions. More...
Public Member Functions | |
SplitSort (int d) | |
Constructs a SplitSort that will use the first d dimensions to sort. More... | |
void | sort (T[] a, int iMin, int iMax) |
void | sort (T[] a) |
void | sort (double[][] a, int iMin, int iMax) |
void | sort (double[][] a) |
int | dimension () |
Implements a MultiDimSortComparable that performs a split sort on a MultiDimComparable<T> array based on its first \(d\) dimensions.
The sort first separates the array in two, such that the objects in the first part are smaller or equal to those in the second part for their coordinate 0. If the number of objects is even, the two parts will contain the same number of objects, otherwise there will be one more in the second part. Then each part is recursively separated in two based on coordinate 1, and so on, until each part contains a single object. If not done yet after splitting on coordinate \(d-1\), the procedure cycles back to coordinate 0, and continues. The resulting order is the result of the sort.
SplitSort | ( | int | d | ) |
Constructs a SplitSort that will use the first d
dimensions to sort.
d | number of dimensions to use for the sort |