Class VectorRank<V extends ValueVector>

java.lang.Object
org.apache.arrow.algorithm.rank.VectorRank<V>
Type Parameters:
V - the vector type

public class VectorRank<V extends ValueVector> extends Object
Utility for calculating ranks of vector elements.
  • Constructor Details

    • VectorRank

      public VectorRank(BufferAllocator allocator)
      Constructs a vector rank utility.
      Parameters:
      allocator - the allocator to use.
  • Method Details

    • indexAtRank

      public int indexAtRank(V vector, VectorValueComparator<V> comparator, int rank)
      Given a rank r, gets the index of the element that is the rth smallest in the vector. The operation is performed without changing the vector, and takes O(n) time, where n is the length of the vector.
      Parameters:
      vector - the vector from which to get the element index.
      comparator - the criteria for vector element comparison.
      rank - the rank to determine.
      Returns:
      the element index with the given rank.