org.apache.datasketches.quantiles

## 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
`static int` `getKFromEpsilon(double epsilon, boolean pmf)` Used by Classic Quantiles.
`static double` `getNormalizedRankError(int k, boolean pmf)` Used by Classic Quantiles.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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 parameter
  `pmf` - 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.