Package org.apache.sysds.runtime.util
Class SortUtils
- java.lang.Object
- 
- org.apache.sysds.runtime.util.SortUtils
 
- 
 public class SortUtils extends Object Utilities for sorting, primarily used for SparseRows.
- 
- 
Constructor SummaryConstructors Constructor Description SortUtils()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static intcompare(double[] d1, double[] d2)static booleanisSorted(int start, int end, double[] values)static booleanisSorted(int start, int end, int[] indexes)static booleanisSorted(MatrixBlock in)static voidsortByIndex(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 voidsortByIndex(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 voidsortByValue(int start, int end, double[] values, int[] indexes)static voidsortByValueStable(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.
 
- 
- 
- 
Method Detail- 
isSortedpublic static boolean isSorted(int start, int end, int[] indexes)
 - 
isSortedpublic static boolean isSorted(int start, int end, double[] values)
 - 
isSortedpublic static boolean isSorted(MatrixBlock in) 
 - 
comparepublic static int compare(double[] d1, double[] d2)
 - 
sortByIndexpublic 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.- Parameters:
- start- starting index
- end- ending index
- indexes- array of indexes to sort by
- values- double array of values to sort
 
 - 
sortByIndexpublic 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.- Parameters:
- start- starting index
- end- ending index
- indexes- ?
- indexes2- ?
- values- ?
 
 - 
sortByValuepublic static void sortByValue(int start, int end, double[] values, int[] indexes)
 - 
sortByValueStablepublic 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.- Parameters:
- start- start index
- end- end index
- values- double array of values to sort
- indexes- int array of indexes to sort by
 
 
- 
 
-