public float[] getQuantiles(final double[] fractions) {
    if (isEmpty()) { return null; }
    KllFloatsQuantileCalculator quant = null;
    final float[] quantiles = new float[fractions.length];
    for (int i = 0; i < fractions.length; i++) {
      final double fraction = fractions[i];
      if (fraction < 0.0 || fraction > 1.0) {
        throw new SketchesArgumentException("Fraction cannot be less than zero or greater than 1.0");
      }
      if      (fraction == 0.0) { quantiles[i] = minValue_; }
      else if (fraction == 1.0) { quantiles[i] = maxValue_; }
      else {
        if (quant == null) {
          quant = getQuantileCalculator();
        }
        quantiles[i] = quant.getQuantile(fraction);
      }
    }
    return quantiles;
  }
public float [ ] getQuantiles ( final double [ ] fractions ) { if ( isEmpty ( ) ) { return null ; } KllFloatsQuantileCalculator quant = null ; final float [ ] quantiles = new float [ fractions . length ] ; for ( int i = 0 ; i < fractions . length ; i ++ ) { final double fraction = fractions [ i ] ; if ( fraction < 0.0 || fraction > 1.0 ) { throw new SketchesArgumentException ( "Fraction cannot be less than zero or greater than 1.0" ) ; } if ( fraction == 0.0 ) { quantiles [ i ] = minValue_ ; } else if ( fraction == 1.0 ) { quantiles [ i ] = maxValue_ ; } else { if ( quant == null ) { quant = getQuantileCalculator ( ) ; } quantiles [ i ] = quant . getQuantile ( fraction ) ; } } return quantiles ; }
This is a more efficient multiple-query version of getQuantile().

<p>This returns an array that could have been generated by using getQuantile() with many
different fractional ranks, but would be very inefficient.
This method incurs the internal set-up overhead once and obtains multiple quantile values in
a single query. It is strongly recommend that this method be used instead of multiple calls
to getQuantile().

<p>If the sketch is empty this returns null.

@param fractions given array of fractional positions in the hypothetical sorted stream.
These are also called normalized ranks or fractional ranks.
These fractions must be in the interval [0.0, 1.0], inclusive.

@return array of approximations to the given fractions in the same order as given fractions
array.