Package org.apache.arrow.algorithm.rank
Class VectorRank<V extends ValueVector>
java.lang.Object
org.apache.arrow.algorithm.rank.VectorRank<V>
- Type Parameters:
V
- the vector type
Utility for calculating ranks of vector elements.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
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.
-
Constructor Details
-
VectorRank
Constructs a vector rank utility.- Parameters:
allocator
- the allocator to use.
-
-
Method Details
-
indexAtRank
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.
-