jhplot.math
Class Sorting
- java.lang.Object
-
- jhplot.math.Sorting
-
public class Sorting extends java.lang.Object
Quick Sort algoritm.Allows to sort a column quickly, Using a generic version of C.A.R Hoare's Quick Sort algorithm.
-
-
Constructor Summary
Constructors Constructor and Description Sorting(double[] array, boolean copyArray)
Construct an ascending order.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description int[]
getIndex()
Get the ascending order of all lines.int
getIndex(int i)
Get the ascending order of one line.static int[]
invertIndex(int[] ind)
static void
main(java.lang.String[] args)
-
-
-
Constructor Detail
-
Sorting
public Sorting(double[] array, boolean copyArray)
Construct an ascending order.- Parameters:
array
- Array to sort.copyArray
- Specify if the sort is made directly : true -> array is modified (usefull for big arrays !), false -> array is copied and not modified (more memory used).
-
-
Method Detail
-
invertIndex
public static int[] invertIndex(int[] ind)
-
getIndex
public int getIndex(int i)
Get the ascending order of one line.- Parameters:
i
- Line number.- Returns:
- Ascending order of the line.
-
getIndex
public int[] getIndex()
Get the ascending order of all lines.- Returns:
- Ascending order of lines.
-
main
public static void main(java.lang.String[] args)
-
-
DMelt 3.0 © DataMelt by jWork.ORG