public class SortUtils extends Object
Constructor and Description |
---|
SortUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
compare(double[] d1,
double[] d2) |
static boolean |
isSorted(int start,
int end,
double[] values) |
static boolean |
isSorted(int start,
int end,
int[] indexes) |
static boolean |
isSorted(MatrixBlock in) |
static void |
sortByIndex(int start,
int end,
int[] indexes,
double[] values)
In-place sort of two arrays, only indexes is used for comparison and values
of same position are sorted accordingly.
|
static void |
sortByIndex(int start,
int end,
int[] indexes,
int[] indexes2,
double[] values)
In-place sort of three arrays, only first indexes is used for comparison and second
indexes as well as values of same position are sorted accordingly.
|
static void |
sortByValue(int start,
int end,
double[] values,
int[] indexes) |
static void |
sortByValueStable(int start,
int end,
double[] values,
int[] indexes)
In-place sort of two arrays, only indexes is used for comparison and values
of same position are sorted accordingly.
|
public static boolean isSorted(int start, int end, int[] indexes)
public static boolean isSorted(int start, int end, double[] values)
public static boolean isSorted(MatrixBlock in)
public static int compare(double[] d1, double[] d2)
public static void sortByIndex(int start, int end, int[] indexes, double[] values)
start
- starting indexend
- ending indexindexes
- array of indexes to sort byvalues
- double array of values to sortpublic static void sortByIndex(int start, int end, int[] indexes, int[] indexes2, double[] values)
start
- starting indexend
- ending indexindexes
- ?indexes2
- ?values
- ?public static void sortByValue(int start, int end, double[] values, int[] indexes)
public static void sortByValueStable(int start, int end, double[] values, int[] indexes)
start
- start indexend
- end indexvalues
- double array of values to sortindexes
- int array of indexes to sort byCopyright © 2020 The Apache Software Foundation. All rights reserved.