Class VectorRank<V extends ValueVector>

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.
      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.
      vector - the vector from which to get the element index.
      comparator - the criteria for vector element comparison.
      rank - the rank to determine.
      the element index with the given rank.