Package org.apache.datasketches.kll
Class KllFloatsSketchSortedView
- java.lang.Object
-
- org.apache.datasketches.kll.KllFloatsSketchSortedView
-
- All Implemented Interfaces:
FloatsSortedView
,SortedView
public final class KllFloatsSketchSortedView extends Object implements FloatsSortedView
The SortedView of the KllFloatsSketch.- Author:
- Alexander Saydakov, Lee Rhodes
-
-
Constructor Summary
Constructors Constructor Description KllFloatsSketchSortedView(KllFloatsSketch sk)
Constructs this Sorted View given the sketch
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long[]
getCumulativeWeights()
Returns the array of cumulative weightsfloat
getQuantile(double rank, QuantileSearchCriteria searchCrit)
Gets the approximate quantile of the given normalized rank and the given search criterion.float[]
getQuantiles()
Returns the array of quantilesdouble
getRank(float quantile, QuantileSearchCriteria searchCrit)
Gets the normalized rank corresponding to the given a quantile.boolean
isEmpty()
Returns true if this sorted view is empty.KllFloatsSketchSortedViewIterator
iterator()
Returns an iterator for this Sorted View.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.datasketches.quantilescommon.FloatsSortedView
getCDF, getPMF
-
-
-
-
Constructor Detail
-
KllFloatsSketchSortedView
public KllFloatsSketchSortedView(KllFloatsSketch sk)
Constructs this Sorted View given the sketch- Parameters:
sk
- the given KllFloatsSketch.
-
-
Method Detail
-
getCumulativeWeights
public long[] getCumulativeWeights()
Description copied from interface:SortedView
Returns the array of cumulative weights- Specified by:
getCumulativeWeights
in interfaceSortedView
- Returns:
- the array of cumulative weights
-
getQuantile
public float getQuantile(double rank, QuantileSearchCriteria searchCrit)
Description copied from interface:FloatsSortedView
Gets the approximate quantile of the given normalized rank and the given search criterion.- Specified by:
getQuantile
in interfaceFloatsSortedView
- Parameters:
rank
- the given normalized rank, a double in the range [0.0, 1.0].searchCrit
- If INCLUSIVE, the given rank includes all quantiles ≤ the quantile directly corresponding to the given rank. If EXCLUSIVE, he given rank includes all quantiles < the quantile directly corresponding to the given rank.- Returns:
- the approximate quantile given the normalized rank.
- See Also:
QuantileSearchCriteria
-
getQuantiles
public float[] getQuantiles()
Description copied from interface:FloatsSortedView
Returns the array of quantiles- Specified by:
getQuantiles
in interfaceFloatsSortedView
- Returns:
- the array of quantiles
-
getRank
public double getRank(float quantile, QuantileSearchCriteria searchCrit)
Description copied from interface:FloatsSortedView
Gets the normalized rank corresponding to the given a quantile.- Specified by:
getRank
in interfaceFloatsSortedView
- Parameters:
quantile
- the given quantilesearchCrit
- if INCLUSIVE the given quantile is included into the rank.- Returns:
- the normalized rank corresponding to the given quantile.
- See Also:
QuantileSearchCriteria
-
isEmpty
public boolean isEmpty()
Description copied from interface:SortedView
Returns true if this sorted view is empty.- Specified by:
isEmpty
in interfaceSortedView
- Returns:
- true if this sorted view is empty.
-
iterator
public KllFloatsSketchSortedViewIterator iterator()
Description copied from interface:SortedView
Returns an iterator for this Sorted View.- Specified by:
iterator
in interfaceFloatsSortedView
- Specified by:
iterator
in interfaceSortedView
- Returns:
- an iterator for this Sorted View.
-
-