java.lang.Object
org.elasticsearch.tdigest.Sort
Static sorting methods
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidreverse(double[] order, int offset, int length) Reverses part of an array.static voidreverse(int[] order) Reverses an array in-place.static voidreverse(int[] order, int offset, int length) Reverses part of an array.static voidsort(double[] key, double[]... values) Quick sort in place of several paired arrays.static voidsort(double[] key, int start, int n, double[]... values) Quick sort using an index array.static booleansort(int[] order, double[] values, double[] weights, int n) Two-key quick sort on (values, weights) using an index arraystatic voidstableSort(int[] order, double[] values, int n) Single-key stabilized quick sort on using an index array
-
Constructor Details
-
Sort
public Sort()
-
-
Method Details
-
stableSort
public static void stableSort(int[] order, double[] values, int n) Single-key stabilized quick sort on using an index array- Parameters:
order- Indexes into valuesvalues- The values to sort.n- The number of values to sort
-
sort
public static boolean sort(int[] order, double[] values, double[] weights, int n) Two-key quick sort on (values, weights) using an index array- Parameters:
order- Indexes into valuesvalues- The values to sort.weights- The secondary sort keyn- The number of values to sort- Returns:
- true if the values were already sorted
-
sort
public static void sort(double[] key, double[]... values) Quick sort in place of several paired arrays. On return, keys[...] is in order and the values[] arrays will be reordered as well in the same way.- Parameters:
key- Values to sort onvalues- The auxiliary values to sort.
-
sort
public static void sort(double[] key, int start, int n, double[]... values) Quick sort using an index array. On return, values[order[i]] is in order as i goes start..n- Parameters:
key- Values to sort onstart- The first element to sortn- The number of values to sortvalues- The auxiliary values to sort.
-
reverse
public static void reverse(int[] order) Reverses an array in-place.- Parameters:
order- The array to reverse
-
reverse
public static void reverse(int[] order, int offset, int length) Reverses part of an array. Seereverse(int[])- Parameters:
order- The array containing the data to reverse.offset- Where to start reversing.length- How many elements to reverse
-
reverse
public static void reverse(double[] order, int offset, int length) Reverses part of an array. Seereverse(int[])- Parameters:
order- The array containing the data to reverse.offset- Where to start reversing.length- How many elements to reverse
-