@SuppressWarnings("WeakerAccess")
    public static void sort(int[] order, double[] values, int start, int n) {
        for (int i = start; i < start + n; i++) {
            order[i] = i;
        }
        quickSort(order, values, start, start + n, 64);
        insertionSort(order, values, start, start + n, 64);
    }
@ SuppressWarnings ( "WeakerAccess" ) public static void sort ( int [ ] order , double [ ] values , int start , int n ) { for ( int i = start ; i < start + n ; i ++ ) { order [ i ] = i ; } quickSort ( order , values , start , start + n , 64 ) ; insertionSort ( order , values , start , start + n , 64 ) ; }
Quick sort using an index array.  On return,
values[order[i]] is in order as i goes start..n

@param order  Indexes into values
@param values The values to sort.
@param start  The first element to sort
@param n      The number of values to sort