SSJ  3.3.1
Stochastic Simulation in Java
Public Member Functions | List of all members
SplitSort< T extends MultiDimComparable<? super T > Class Template Reference

Implements a MultiDimSortComparable that performs a split sort on a MultiDimComparable<T> array based on its first \(d\) dimensions. More...

Inheritance diagram for SplitSort< T extends MultiDimComparable<? super T >:
[legend]
Collaboration diagram for SplitSort< T extends MultiDimComparable<? super T >:
[legend]

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 ()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SplitSort()

SplitSort ( int  d)

Constructs a SplitSort that will use the first d dimensions to sort.

Parameters
dnumber of dimensions to use for the sort

The documentation for this class was generated from the following file: