Class ClassicUtil
- java.lang.Object
-
- org.apache.datasketches.quantiles.ClassicUtil
-
public final class ClassicUtil extends Object
Utilities for the classic quantiles sketches and independent of the type.- Author:
- Lee Rhodes
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getKFromEpsilon(double epsilon, boolean pmf)
Used by Classic Quantiles.static double
getNormalizedRankError(int k, boolean pmf)
Used by Classic Quantiles.
-
-
-
Method Detail
-
getNormalizedRankError
public static double getNormalizedRankError(int k, boolean pmf)
Used by Classic Quantiles. Gets the normalized rank error given k and pmf for the Quantiles DoubleSketch and ItemsSketch.- Parameters:
k
- the configuration parameterpmf
- if true, returns the "double-sided" normalized rank error for the getPMF() function. Otherwise, it is the "single-sided" normalized rank error for all the other queries.- Returns:
- if pmf is true, the normalized rank error for the getPMF() function. Otherwise, it is the "single-sided" normalized rank error for all the other queries.
-
getKFromEpsilon
public static int getKFromEpsilon(double epsilon, boolean pmf)
Used by Classic Quantiles. Gets the approximate k to use given epsilon, the normalized rank error for the Quantiles DoubleSketch and ItemsSketch.- Parameters:
epsilon
- the normalized rank error between zero and one.pmf
- if true, this function returns k assuming the input epsilon is the desired "double-sided" epsilon for the getPMF() function. Otherwise, this function returns k assuming the input epsilon is the desired "single-sided" epsilon for all the other queries.- Returns:
- k given epsilon.
-
-