Package 

Class SortingKt

    • Method Summary

      Modifier and Type Method Description
      final Unit sort(F64Array $self, Boolean reverse) Sorts the elements in this 1-D array in in descending order.
      final IntArray argSort(F64Array $self, Boolean reverse) Returns a permutation of indices which makes the 1-D array sorted.
      final Unit partition(F64Array $self, Integer p) Partitions the array.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 - if true the elements are sorted in ascending order.
      • 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.