java.lang.Object
org.elasticsearch.tdigest.Sort

public class Sort extends Object
Static sorting methods
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    reverse(double[] order, int offset, int length)
    Reverses part of an array.
    static void
    reverse(int[] order)
    Reverses an array in-place.
    static void
    reverse(int[] order, int offset, int length)
    Reverses part of an array.
    static void
    sort(double[] key, double[]... values)
    Quick sort in place of several paired arrays.
    static void
    sort(double[] key, int start, int n, double[]... values)
    Quick sort using an index array.
    static boolean
    sort(int[] order, double[] values, double[] weights, int n)
    Two-key quick sort on (values, weights) using an index array
    static void
    stableSort(int[] order, double[] values, int n)
    Single-key stabilized quick sort on using an index array

    Methods inherited from class java.lang.Object

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

    • Sort

      public Sort()
  • Method Details

    • stableSort

      public static void stableSort(int[] order, double[] values, int n)
      Single-key stabilized quick sort on using an index array
      Parameters:
      order - Indexes into values
      values - The values to sort.
      n - The number of values to sort
    • sort

      public static boolean sort(int[] order, double[] values, double[] weights, int n)
      Two-key quick sort on (values, weights) using an index array
      Parameters:
      order - Indexes into values
      values - The values to sort.
      weights - The secondary sort key
      n - The number of values to sort
      Returns:
      true if the values were already sorted
    • sort

      public static void sort(double[] key, double[]... values)
      Quick sort in place of several paired arrays. On return, keys[...] is in order and the values[] arrays will be reordered as well in the same way.
      Parameters:
      key - Values to sort on
      values - The auxiliary values to sort.
    • sort

      public static void sort(double[] key, int start, int n, double[]... values)
      Quick sort using an index array. On return, values[order[i]] is in order as i goes start..n
      Parameters:
      key - Values to sort on
      start - The first element to sort
      n - The number of values to sort
      values - The auxiliary values to sort.
    • reverse

      public static void reverse(int[] order)
      Reverses an array in-place.
      Parameters:
      order - The array to reverse
    • reverse

      public static void reverse(int[] order, int offset, int length)
      Reverses part of an array. See reverse(int[])
      Parameters:
      order - The array containing the data to reverse.
      offset - Where to start reversing.
      length - How many elements to reverse
    • reverse

      public static void reverse(double[] order, int offset, int length)
      Reverses part of an array. See reverse(int[])
      Parameters:
      order - The array containing the data to reverse.
      offset - Where to start reversing.
      length - How many elements to reverse