/** * 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. * * @param key Values to sort on * @param values The auxilliary values to sort. */ @SuppressWarnings("WeakerAccess") public static void sort(double[] key, double[] ... values) { sort(key, 0, key.length, values); }
/** * Quick sort using an index array. On return, * values[order[i]] is in order as i goes 0..values.length * * @param order Indexes into values * @param values The values to sort. */ @SuppressWarnings("WeakerAccess") public static void sort(int[] order, double[] values) { sort(order, values, 0, values.length); }
/** * Quick sort using an index array. On return, * values[order[i]] is in order as i goes 0..n * * @param order Indexes into values * @param values The values to sort. * @param n The number of values to sort */ @SuppressWarnings("WeakerAccess") public static void sort(int[] order, double[] values, int n) { sort(order, values, 0, n); }
@Benchmark public void quicksort() { int[] order = new int[size]; for (int i = 0; i < size; i++) { order[i] = i; } Sort.sort(order, values); } }
incomingOrder = new int[incomingCount]; Sort.sort(incomingOrder, incomingMean, incomingCount);
private void mergeNewValues() { if (unmergedWeight > 0) { Sort.sort(order, tempMean, tempUsed);
private void mergeNewValues() { if (unmergedWeight > 0) { Sort.sort(order, tempMean, tempUsed);