Class KthSelector
- java.lang.Object
-
- com.macrofocus.molap.aggregates.cube.KthSelector
-
public class KthSelector extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description KthSelector()
Constructor with defaultmedian of 3
pivoting strategyKthSelector(PivotingStrategyInterface pivotingStrategy)
Constructor with specified pivoting strategy
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PivotingStrategyInterface
getPivotingStrategy()
Get the pivotin strategy.double
select(double[] work, int[] pivotsHeap, int k)
Select Kth value in the array.
-
-
-
Constructor Detail
-
KthSelector
public KthSelector()
Constructor with defaultmedian of 3
pivoting strategy
-
KthSelector
public KthSelector(PivotingStrategyInterface pivotingStrategy)
Constructor with specified pivoting strategy- Parameters:
pivotingStrategy
- pivoting strategy to use- See Also:
MedianOf3PivotingStrategy
-
-
Method Detail
-
getPivotingStrategy
public PivotingStrategyInterface getPivotingStrategy()
Get the pivotin strategy.- Returns:
- pivoting strategy
-
select
public double select(double[] work, int[] pivotsHeap, int k)
Select Kth value in the array.- Parameters:
work
- work array to use to find out the Kth valuepivotsHeap
- cached pivots heap that can be used for efficient estimationk
- the index whose value in the array is of interest- Returns:
- Kth value
-
-