Documentation of 'jsat.utils.QuickSort' Java class
QuickSort
jsat.utils

Class QuickSort



  • public class QuickSort
    extends java.lang.Object
    Provides implementations of quicksort. This is for use to obtain explicitly desired behavior, as well as aovid overhead by explicitly allowing extra Lists when sorting that are swapped when the array/list being sorted is swapped.

    This class exist solely for performance reasons.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void insertionSort(double[] x, int start, int end) 
      static void sort(double[] x, int start, int end)
      Performs sorting based on the double values natural comparator.
      static void sort(double[] x, int start, int end, java.util.Collection<java.util.List<?>> paired)
      Performs sorting based on the double values natural comparator.
      static void sort(float[] x, int start, int end, java.util.Collection<java.util.List<?>> paired)
      Performs sorting based on the double values natural comparator.
      static void swap(double[] array, int i, int j) 
      static void swap(double[] array, int i, int j, java.util.Collection<java.util.List<?>> paired) 
      static void swap(float[] array, int i, int j) 
      static void swap(float[] array, int i, int j, java.util.Collection<java.util.List<?>> paired) 
      static void swapC(double[] array, int i, int j)
      Conditional swap, only swaps the values if array[i] > array[j]
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • swap

        public static void swap(double[] array,
                                int i,
                                int j)
      • swap

        public static void swap(float[] array,
                                int i,
                                int j)
      • swapC

        public static void swapC(double[] array,
                                 int i,
                                 int j)
        Conditional swap, only swaps the values if array[i] > array[j]
        Parameters:
        array - the array to potentially swap values in
        i - the 1st index
        j - the 2nd index
      • swap

        public static void swap(double[] array,
                                int i,
                                int j,
                                java.util.Collection<java.util.List<?>> paired)
        Parameters:
        array - the array to swap values in
        i - the 1st index
        j - the 2nd index
        paired - a collection of lists, every list will have its indices swapped as well
      • swap

        public static void swap(float[] array,
                                int i,
                                int j,
                                java.util.Collection<java.util.List<?>> paired)
        Parameters:
        array - the array to swap values in
        i - the 1st index
        j - the 2nd index
        paired - a collection of lists, every list will have its indices swapped as well
      • sort

        public static void sort(double[] x,
                                int start,
                                int end)
        Performs sorting based on the double values natural comparator. Double.NaN values will not be handled appropriately.
        Parameters:
        x - the array to sort
        start - the starting index (inclusive) to sort
        end - the ending index (exclusive) to sort
      • insertionSort

        public static void insertionSort(double[] x,
                                         int start,
                                         int end)
        Parameters:
        x -
        start - inclusive
        end - exclusive
      • sort

        public static void sort(double[] x,
                                int start,
                                int end,
                                java.util.Collection<java.util.List<?>> paired)
        Performs sorting based on the double values natural comparator. Double.NaN values will not be handled appropriately.
        Parameters:
        x - the array to sort
        start - the starting index (inclusive) to sort
        end - the ending index (exclusive) to sort
        paired - a collection of lists, every list will have its indices swapped as well
      • sort

        public static void sort(float[] x,
                                int start,
                                int end,
                                java.util.Collection<java.util.List<?>> paired)
        Performs sorting based on the double values natural comparator. Double.NaN values will not be handled appropriately.
        Parameters:
        x - the array to sort
        start - the starting index (inclusive) to sort
        end - the ending index (exclusive) to sort
        paired - a collection of lists, every list will have its indices swapped as well

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.