Package com.tdunning.math.stats
Class Sort
- java.lang.Object
-
- com.tdunning.math.stats.Sort
-
public class Sort extends Object
Static sorting methods
-
-
Constructor Summary
Constructors Constructor Description Sort()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheckPartition(int[] order, double[] values, double pivotValue, int start, int low, int high, int end)Check that a partition step was done correctly.static voidsort(int[] order, double[] values)Quick sort using an index array.static voidsort(int[] order, double[] values, int n)Quick sort using an index array.
-
-
-
Method Detail
-
sort
public static void sort(int[] order, double[] values)Quick sort using an index array. On return, the values[order[i]] is in order as i goes 0..values.length- Parameters:
order- Indexes into valuesvalues- The values to sort.
-
sort
public static void sort(int[] order, double[] values, int n)Quick sort using an index array. On return, the values[order[i]] is in order as i goes 0..values.length- Parameters:
order- Indexes into valuesvalues- The values to sort.n- The number of values to sort
-
checkPartition
public static void checkPartition(int[] order, double[] values, double pivotValue, int start, int low, int high, int end)Check that a partition step was done correctly. For debugging and testing.
-
-