-
public final class SortingKt
-
-
Method Summary
Modifier and Type Method Description final Unitsort(F64Array $self, Boolean reverse)Sorts the elements in this 1-D array in in descending order. final IntArrayargSort(F64Array $self, Boolean reverse)Returns a permutation of indices which makes the 1-D array sorted. final Unitpartition(F64Array $self, Integer p)Partitions the array. -
-
Method Detail
-
sort
final Unit sort(F64Array $self, Boolean reverse)
Sorts the elements in this 1-D array in in descending order.
The operation is done in place.
- Parameters:
reverse- iftruethe elements are sorted inascendingorder.
-
argSort
final IntArray argSort(F64Array $self, Boolean reverse)
Returns a permutation of indices which makes the 1-D array sorted.
- Parameters:
reverse- see sort for details.
-
partition
final Unit partition(F64Array $self, Integer p)
Partitions the array.
Rearranges the elements in this array in such a way that the p-th element moves to its position in the sorted copy of the array. All elements smaller than the p-th element are moved before this element, and all elements greater or equals to this element are moved behind it.
The operation is done in place.
- Parameters:
p- the index of the element to partition by.
-
-
-
-