Class QuickSort_F64

java.lang.Object
org.ddogleg.sorting.QuickSort_F64

public class QuickSort_F64
extends Object
An implementation of the quick sort algorithm from Numerical Recipes Third Edition that is specified for arrays of doubles. A small amount of memory is declared for this sorting algorithm. This implementation seems to often perform slower than Shell sort. A comment in Numerical recipes about unnecessary array checks makes me think this is slow because java always does a bounds check on arrays. This has slightly better performance than Arrays.sort(double[]). Not noticeable in most applications.
  • Constructor Summary

    Constructors
    Constructor Description
    QuickSort_F64()  
    QuickSort_F64​(int NSTACK, int M)  
  • Method Summary

    Modifier and Type Method Description
    void sort​(double[] arr, int length)  
    void sort​(double[] arr, int offset, int length, int[] indexes)  
    <T> void sort​(double[] arr, int length, List<T> list)
    Sorts the array and modifies the order in the list the same way

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • QuickSort_F64

      public QuickSort_F64()
    • QuickSort_F64

      public QuickSort_F64​(int NSTACK, int M)
  • Method Details

    • sort

      public void sort​(double[] arr, int length)
    • sort

      public void sort​(double[] arr, int offset, int length, int[] indexes)
    • sort

      public <T> void sort​(double[] arr, int length, List<T> list)
      Sorts the array and modifies the order in the list the same way