blob: f49515221c5171f79f7f505ee26f8d21af6d92e3 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_162) on Thu Oct 25 17:06:10 PDT 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>KllFloatsSketch (com.yahoo.datasketches:sketches-core 0.12.1-SNAPSHOT API)</title>
<meta name="date" content="2018-10-25">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="KllFloatsSketch (com.yahoo.datasketches:sketches-core 0.12.1-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":9,"i2":9,"i3":10,"i4":10,"i5":10,"i6":42,"i7":10,"i8":41,"i9":9,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":9,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/KllFloatsSketch.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev&nbsp;Class</li>
<li><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketchIterator.html" title="class in com.yahoo.sketches.kll"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/yahoo/sketches/kll/KllFloatsSketch.html" target="_top">Frames</a></li>
<li><a href="KllFloatsSketch.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.yahoo.sketches.kll</div>
<h2 title="Class KllFloatsSketch" class="title">Class KllFloatsSketch</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>com.yahoo.sketches.kll.KllFloatsSketch</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">KllFloatsSketch</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">Implementation of a very compact quantiles sketch with lazy compaction scheme
and nearly optimal accuracy per retained item.
See <a href="https://arxiv.org/abs/1603.05346v2">Optimal Quantile Approximation in Streams</a>.
<p>This is a stochastic streaming sketch that enables near-real time analysis of the
approximate distribution of values from a very large stream in a single pass, requiring only
that the values are comparable.
The analysis is obtained using <i>getQuantile()</i> or <i>getQuantiles()</i> functions or the
inverse functions getRank(), getPMF() (Probability Mass Function), and getCDF()
(Cumulative Distribution Function).
<p>Given an input stream of <i>N</i> numeric values, the <i>absolute rank</i> of any specific
value is defined as its index <i>(0 to N-1)</i> in the hypothetical sorted stream of all
<i>N</i> input values.
<p>The <i>normalized rank</i> (<i>rank</i>) of any specific value is defined as its
<i>absolute rank</i> divided by <i>N</i>.
Thus, the <i>normalized rank</i> is a value between zero and one.
In the documentation and Javadocs for this sketch <i>absolute rank</i> is never used so any
reference to just <i>rank</i> should be interpreted to mean <i>normalized rank</i>.
<p>This sketch is configured with a parameter <i>k</i>, which affects the size of the sketch
and its estimation error.
<p>The estimation error is commonly called <i>epsilon</i> (or <i>eps</i>) and is a fraction
between zero and one. Larger values of <i>k</i> result in smaller values of epsilon.
Epsilon is always with respect to the rank and cannot be applied to the
corresponding values.
<p>The relationship between the normalized rank and the corresponding values can be viewed
as a two dimensional monotonic plot with the normalized rank on one axis and the
corresponding values on the other axis. If the y-axis is specified as the value-axis and
the x-axis as the normalized rank, then <i>y = getQuantile(x)</i> is a monotonically
increasing function.
<p>The functions <i>getQuantile(rank)</i> and getQuantiles(...) translate ranks into
corresponding values. The functions <i>getRank(value),
getCDF(...) (Cumulative Distribution Function), and getPMF(...)
(Probability Mass Function)</i> perform the opposite operation and translate values into ranks.
<p>The <i>getPMF(...)</i> function has about 13 to 47% worse rank error (depending
on <i>k</i>) than the other queries because the mass of each "bin" of the PMF has
"double-sided" error from the upper and lower edges of the bin as a result of a subtraction,
as the errors from the two edges can sometimes add.
<p>The default <i>k</i> of 200 yields a "single-sided" epsilon of about 1.33% and a
"double-sided" (PMF) epsilon of about 1.65%.
<p>A <i>getQuantile(rank)</i> query has the following guarantees:
<ul>
<li>Let <i>v = getQuantile(r)</i> where <i>r</i> is the rank between zero and one.</li>
<li>The value <i>v</i> will be a value from the input stream.</li>
<li>Let <i>trueRank</i> be the true rank of <i>v</i> derived from the hypothetical sorted
stream of all <i>N</i> values.</li>
<li>Let <i>eps = getNormalizedRankError(false)</i>.</li>
<li>Then <i>r - eps &le; trueRank &le; r + eps</i> with a confidence of 99%. Note that the
error is on the rank, not the value.</li>
</ul>
<p>A <i>getRank(value)</i> query has the following guarantees:
<ul>
<li>Let <i>r = getRank(v)</i> where <i>v</i> is a value between the min and max values of
the input stream.</li>
<li>Let <i>trueRank</i> be the true rank of <i>v</i> derived from the hypothetical sorted
stream of all <i>N</i> values.</li>
<li>Let <i>eps = getNormalizedRankError(false)</i>.</li>
<li>Then <i>r - eps &le; trueRank &le; r + eps</i> with a confidence of 99%.</li>
</ul>
<p>A <i>getPMF()</i> query has the following guarantees:
<ul>
<li>Let <i>{r1, r2, ..., r(m+1)} = getPMF(v1, v2, ..., vm)</i> where <i>v1, v2</i> are values
between the min and max values of the input stream.
<li>Let <i>mass<sub>i</sub> = estimated mass between v<sub>i</sub> and v<sub>i+1</sub></i>.</li>
<li>Let <i>trueMass</i> be the true mass between the values of <i>v<sub>i</sub>,
v<sub>i+1</sub></i> derived from the hypothetical sorted stream of all <i>N</i> values.</li>
<li>Let <i>eps = getNormalizedRankError(true)</i>.</li>
<li>then <i>mass - eps &le; trueMass &le; mass + eps</i> with a confidence of 99%.</li>
<li>r(m+1) includes the mass of all points larger than vm.</li>
</ul>
<p>A <i>getCDF(...)</i> query has the following guarantees;
<ul>
<li>Let <i>{r1, r2, ..., r(m+1)} = getCDF(v1, v2, ..., vm)</i> where <i>v1, v2</i> are values
between the min and max values of the input stream.
<li>Let <i>mass<sub>i</sub> = r<sub>i+1</sub> - r<sub>i</sub></i>.</li>
<li>Let <i>trueMass</i> be the true mass between the true ranks of <i>v<sub>i</sub>,
v<sub>i+1</sub></i> derived from the hypothetical sorted stream of all <i>N</i> values.</li>
<li>Let <i>eps = getNormalizedRankError(true)</i>.</li>
<li>then <i>mass - eps &le; trueMass &le; mass + eps</i> with a confidence of 99%.</li>
<li>1 - r(m+1) includes the mass of all points larger than vm.</li>
</ul>
<p>From the above, it might seem like we could make some estimates to bound the
<em>value</em> returned from a call to <em>getQuantile()</em>. The sketch, however, does not
let us derive error bounds or confidences around values. Because errors are independent, we
can approximately bracket a value as shown below, but there are no error estimates available.
Additionally, the interval may be quite large for certain distributions.
<ul>
<li>Let <i>v = getQuantile(r)</i>, the estimated quantile value of rank <i>r</i>.</li>
<li>Let <i>eps = getNormalizedRankError(false)</i>.</li>
<li>Let <i>v<sub>lo</sub></i> = estimated quantile value of rank <i>(r - eps)</i>.</li>
<li>Let <i>v<sub>hi</sub></i> = estimated quantile value of rank <i>(r + eps)</i>.</li>
<li>Then <i>v<sub>lo</sub> &le; v &le; v<sub>hi</sub></i>, with 99% confidence.</li>
</ul></div>
<dl>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>Kevin Lang, Alexander Saydakov, Lee Rhodes</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#DEFAULT_K">DEFAULT_K</a></span></code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#KllFloatsSketch--">KllFloatsSketch</a></span>()</code>
<div class="block">Constructor with the default <em>k</em> (rank error of about 1.65%)</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#KllFloatsSketch-int-">KllFloatsSketch</a></span>(int&nbsp;k)</code>
<div class="block">Constructor with a given parameter <em>k</em>.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>double[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getCDF-float:A-">getCDF</a></span>(float[]&nbsp;splitPoints)</code>
<div class="block">Returns an approximation to the Cumulative Distribution Function (CDF), which is the
cumulative analog of the PMF, of the input stream given a set of splitPoint (values).</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getKFromEpsilon-double-boolean-">getKFromEpsilon</a></span>(double&nbsp;epsilon,
boolean&nbsp;pmf)</code>
<div class="block">Gets the approximate value of <em>k</em> to use given epsilon, the normalized rank error.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getMaxSerializedSizeBytes-int-long-">getMaxSerializedSizeBytes</a></span>(int&nbsp;k,
long&nbsp;n)</code>
<div class="block">Returns upper bound on the serialized size of a sketch given a parameter <em>k</em> and stream
length.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getMaxValue--">getMaxValue</a></span>()</code>
<div class="block">Returns the max value of the stream.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getMinValue--">getMinValue</a></span>()</code>
<div class="block">Returns the min value of the stream.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getN--">getN</a></span>()</code>
<div class="block">Returns the length of the input stream.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getNormalizedRankError--">getNormalizedRankError</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">replaced by <a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getNormalizedRankError-boolean-"><code>getNormalizedRankError(boolean)</code></a></span></div>
</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getNormalizedRankError-boolean-">getNormalizedRankError</a></span>(boolean&nbsp;pmf)</code>
<div class="block">Gets the approximate rank error of this sketch normalized as a fraction between zero and one.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getNormalizedRankError-int-">getNormalizedRankError</a></span>(int&nbsp;k)</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">replaced by <a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getNormalizedRankError-int-boolean-"><code>getNormalizedRankError(int, boolean)</code></a></span></div>
</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getNormalizedRankError-int-boolean-">getNormalizedRankError</a></span>(int&nbsp;k,
boolean&nbsp;pmf)</code>
<div class="block">Gets the normalized rank error given k and pmf.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getNumRetained--">getNumRetained</a></span>()</code>
<div class="block">Returns the number of retained items (samples) in the sketch.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>double[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getPMF-float:A-">getPMF</a></span>(float[]&nbsp;splitPoints)</code>
<div class="block">Returns an approximation to the Probability Mass Function (PMF) of the input stream
given a set of splitPoints (values).</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getQuantile-double-">getQuantile</a></span>(double&nbsp;fraction)</code>
<div class="block">Returns an approximation to the value of the data item
that would be preceded by the given fraction of a hypothetical sorted
version of the input stream so far.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getQuantileLowerBound-double-">getQuantileLowerBound</a></span>(double&nbsp;fraction)</code>
<div class="block">Gets the lower bound of the value interval in which the true quantile of the given rank
exists with a confidence of at least 99%.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>float[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getQuantiles-double:A-">getQuantiles</a></span>(double[]&nbsp;fractions)</code>
<div class="block">This is a more efficient multiple-query version of getQuantile().</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getQuantileUpperBound-double-">getQuantileUpperBound</a></span>(double&nbsp;fraction)</code>
<div class="block">Gets the upper bound of the value interval in which the true quantile of the given rank
exists with a confidence of at least 99%.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getRank-float-">getRank</a></span>(float&nbsp;value)</code>
<div class="block">Returns an approximation to the normalized (fractional) rank of the given value from 0 to 1,
inclusive.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getSerializedSizeBytes--">getSerializedSizeBytes</a></span>()</code>
<div class="block">Returns the number of bytes this sketch would require to store.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>static <a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html" title="class in com.yahoo.sketches.kll">KllFloatsSketch</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#heapify-com.yahoo.memory.Memory-">heapify</a></span>(com.yahoo.memory.Memory&nbsp;mem)</code>
<div class="block">Heapify takes the sketch image in Memory and instantiates an on-heap sketch.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#isEmpty--">isEmpty</a></span>()</code>
<div class="block">Returns true if this sketch is empty.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#isEstimationMode--">isEstimationMode</a></span>()</code>
<div class="block">Returns true if this sketch is in estimation mode.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketchIterator.html" title="class in com.yahoo.sketches.kll">KllFloatsSketchIterator</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#iterator--">iterator</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#merge-com.yahoo.sketches.kll.KllFloatsSketch-">merge</a></span>(<a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html" title="class in com.yahoo.sketches.kll">KllFloatsSketch</a>&nbsp;other)</code>
<div class="block">Merges another sketch into this one.</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#toByteArray--">toByteArray</a></span>()</code>
<div class="block">Returns serialized sketch in a byte array form.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#toString--">toString</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#toString-boolean-boolean-">toString</a></span>(boolean&nbsp;withLevels,
boolean&nbsp;withData)</code>
<div class="block">Returns a summary of the sketch as a string.</div>
</td>
</tr>
<tr id="i26" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#update-float-">update</a></span>(float&nbsp;value)</code>
<div class="block">Updates this sketch with the given data item.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="DEFAULT_K">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>DEFAULT_K</h4>
<pre>public static final&nbsp;int DEFAULT_K</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../constant-values.html#com.yahoo.sketches.kll.KllFloatsSketch.DEFAULT_K">Constant Field Values</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="KllFloatsSketch--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>KllFloatsSketch</h4>
<pre>public&nbsp;KllFloatsSketch()</pre>
<div class="block">Constructor with the default <em>k</em> (rank error of about 1.65%)</div>
</li>
</ul>
<a name="KllFloatsSketch-int-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>KllFloatsSketch</h4>
<pre>public&nbsp;KllFloatsSketch(int&nbsp;k)</pre>
<div class="block">Constructor with a given parameter <em>k</em>. <em>k</em> can be any value between 8 and
65535, inclusive. The default <em>k</em> = 200 results in a normalized rank error of about
1.65%. Higher values of K will have smaller error but the sketch will be larger (and slower).</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>k</code> - parameter that controls size of the sketch and accuracy of estimates</dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getN--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getN</h4>
<pre>public&nbsp;long&nbsp;getN()</pre>
<div class="block">Returns the length of the input stream.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>stream length</dd>
</dl>
</li>
</ul>
<a name="isEmpty--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isEmpty</h4>
<pre>public&nbsp;boolean&nbsp;isEmpty()</pre>
<div class="block">Returns true if this sketch is empty.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>empty flag</dd>
</dl>
</li>
</ul>
<a name="getNumRetained--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNumRetained</h4>
<pre>public&nbsp;int&nbsp;getNumRetained()</pre>
<div class="block">Returns the number of retained items (samples) in the sketch.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the number of retained items (samples) in the sketch</dd>
</dl>
</li>
</ul>
<a name="isEstimationMode--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isEstimationMode</h4>
<pre>public&nbsp;boolean&nbsp;isEstimationMode()</pre>
<div class="block">Returns true if this sketch is in estimation mode.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>estimation mode flag</dd>
</dl>
</li>
</ul>
<a name="update-float-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre>public&nbsp;void&nbsp;update(float&nbsp;value)</pre>
<div class="block">Updates this sketch with the given data item.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - an item from a stream of items. NaNs are ignored.</dd>
</dl>
</li>
</ul>
<a name="merge-com.yahoo.sketches.kll.KllFloatsSketch-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>merge</h4>
<pre>public&nbsp;void&nbsp;merge(<a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html" title="class in com.yahoo.sketches.kll">KllFloatsSketch</a>&nbsp;other)</pre>
<div class="block">Merges another sketch into this one.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>other</code> - sketch to merge into this one</dd>
</dl>
</li>
</ul>
<a name="getMinValue--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMinValue</h4>
<pre>public&nbsp;float&nbsp;getMinValue()</pre>
<div class="block">Returns the min value of the stream.
If the sketch is empty this returns NaN.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the min value of the stream</dd>
</dl>
</li>
</ul>
<a name="getMaxValue--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxValue</h4>
<pre>public&nbsp;float&nbsp;getMaxValue()</pre>
<div class="block">Returns the max value of the stream.
If the sketch is empty this returns NaN.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the max value of the stream</dd>
</dl>
</li>
</ul>
<a name="getQuantile-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getQuantile</h4>
<pre>public&nbsp;float&nbsp;getQuantile(double&nbsp;fraction)</pre>
<div class="block">Returns an approximation to the value of the data item
that would be preceded by the given fraction of a hypothetical sorted
version of the input stream so far.
<p>We note that this method has a fairly large overhead (microseconds instead of nanoseconds)
so it should not be called multiple times to get different quantiles from the same
sketch. Instead use getQuantiles(), which pays the overhead only once.
<p>If the sketch is empty this returns NaN.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>fraction</code> - the specified fractional position in the hypothetical sorted stream.
These are also called normalized ranks or fractional ranks.
If fraction = 0.0, the true minimum value of the stream is returned.
If fraction = 1.0, the true maximum value of the stream is returned.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the approximation to the value at the given fraction</dd>
</dl>
</li>
</ul>
<a name="getQuantileUpperBound-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getQuantileUpperBound</h4>
<pre>public&nbsp;float&nbsp;getQuantileUpperBound(double&nbsp;fraction)</pre>
<div class="block">Gets the upper bound of the value interval in which the true quantile of the given rank
exists with a confidence of at least 99%.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>fraction</code> - the given normalized rank as a fraction</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the upper bound of the value interval in which the true quantile of the given rank
exists with a confidence of at least 99%. Returns NaN if the sketch is empty.</dd>
</dl>
</li>
</ul>
<a name="getQuantileLowerBound-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getQuantileLowerBound</h4>
<pre>public&nbsp;float&nbsp;getQuantileLowerBound(double&nbsp;fraction)</pre>
<div class="block">Gets the lower bound of the value interval in which the true quantile of the given rank
exists with a confidence of at least 99%.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>fraction</code> - the given normalized rank as a fraction</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the lower bound of the value interval in which the true quantile of the given rank
exists with a confidence of at least 99%. Returns NaN if the sketch is empty.</dd>
</dl>
</li>
</ul>
<a name="getQuantiles-double:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getQuantiles</h4>
<pre>public&nbsp;float[]&nbsp;getQuantiles(double[]&nbsp;fractions)</pre>
<div class="block">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.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>fractions</code> - 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.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>array of approximations to the given fractions in the same order as given fractions
array.</dd>
</dl>
</li>
</ul>
<a name="getRank-float-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRank</h4>
<pre>public&nbsp;double&nbsp;getRank(float&nbsp;value)</pre>
<div class="block">Returns an approximation to the normalized (fractional) rank of the given value from 0 to 1,
inclusive.
<p>The resulting approximation has a probabilistic guarantee that be obtained from the
getNormalizedRankError(false) function.
<p>If the sketch is empty this returns NaN.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - to be ranked</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an approximate rank of the given value</dd>
</dl>
</li>
</ul>
<a name="getPMF-float:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPMF</h4>
<pre>public&nbsp;double[]&nbsp;getPMF(float[]&nbsp;splitPoints)</pre>
<div class="block">Returns an approximation to the Probability Mass Function (PMF) of the input stream
given a set of splitPoints (values).
<p>The resulting approximations have a probabilistic guarantee that be obtained from the
getNormalizedRankError(true) function.
<p>If the sketch is empty this returns null.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>splitPoints</code> - an array of <i>m</i> unique, monotonically increasing float values
that divide the real number line into <i>m+1</i> consecutive disjoint intervals.
The definition of an "interval" is inclusive of the left splitPoint (or minimum value) and
exclusive of the right splitPoint, with the exception that the last interval will include
the maximum value.
It is not necessary to include either the min or max values in these splitpoints.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array of m+1 doubles each of which is an approximation
to the fraction of the input stream values (the mass) that fall into one of those intervals.
The definition of an "interval" is inclusive of the left splitPoint and exclusive of the right
splitPoint, with the exception that the last interval will include maximum value.</dd>
</dl>
</li>
</ul>
<a name="getCDF-float:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCDF</h4>
<pre>public&nbsp;double[]&nbsp;getCDF(float[]&nbsp;splitPoints)</pre>
<div class="block">Returns an approximation to the Cumulative Distribution Function (CDF), which is the
cumulative analog of the PMF, of the input stream given a set of splitPoint (values).
<p>The resulting approximations have a probabilistic guarantee that be obtained from the
getNormalizedRankError(false) function.
<p>If the sketch is empty this returns null.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>splitPoints</code> - an array of <i>m</i> unique, monotonically increasing float values
that divide the real number line into <i>m+1</i> consecutive disjoint intervals.
The definition of an "interval" is inclusive of the left splitPoint (or minimum value) and
exclusive of the right splitPoint, with the exception that the last interval will include
the maximum value.
It is not necessary to include either the min or max values in these splitpoints.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array of m+1 double values, which are a consecutive approximation to the CDF
of the input stream given the splitPoints. The value at array position j of the returned
CDF array is the sum of the returned values in positions 0 through j of the returned PMF
array.</dd>
</dl>
</li>
</ul>
<a name="getNormalizedRankError--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNormalizedRankError</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
public&nbsp;double&nbsp;getNormalizedRankError()</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">replaced by <a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getNormalizedRankError-boolean-"><code>getNormalizedRankError(boolean)</code></a></span></div>
<div class="block">Gets the approximate "double-sided" rank error for the <i>getPMF()</i> function of this
sketch normalized as a fraction between zero and one.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the rank error normalized as a fraction between zero and one.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html" title="class in com.yahoo.sketches.kll"><code>KllFloatsSketch</code></a></dd>
</dl>
</li>
</ul>
<a name="getNormalizedRankError-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNormalizedRankError</h4>
<pre>public&nbsp;double&nbsp;getNormalizedRankError(boolean&nbsp;pmf)</pre>
<div class="block">Gets the approximate rank error of this sketch normalized as a fraction between zero and one.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>pmf</code> - 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.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>if pmf is true, returns the normalized rank error for the getPMF() function.
Otherwise, it is the "single-sided" normalized rank error for all the other queries.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html" title="class in com.yahoo.sketches.kll"><code>KllFloatsSketch</code></a></dd>
</dl>
</li>
</ul>
<a name="getNormalizedRankError-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNormalizedRankError</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
public static&nbsp;double&nbsp;getNormalizedRankError(int&nbsp;k)</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">replaced by <a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getNormalizedRankError-int-boolean-"><code>getNormalizedRankError(int, boolean)</code></a></span></div>
<div class="block">Static method version of the double-sided <a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getNormalizedRankError--"><code>getNormalizedRankError()</code></a> that
specifies <em>k</em>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>k</code> - the configuration parameter</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the normalized "double-sided" rank error as a function of <em>k</em>.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html" title="class in com.yahoo.sketches.kll"><code>KllFloatsSketch</code></a></dd>
</dl>
</li>
</ul>
<a name="getNormalizedRankError-int-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNormalizedRankError</h4>
<pre>public static&nbsp;double&nbsp;getNormalizedRankError(int&nbsp;k,
boolean&nbsp;pmf)</pre>
<div class="block">Gets the normalized rank error given k and pmf.
Static method version of the <a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html#getNormalizedRankError-boolean-"><code>getNormalizedRankError(boolean)</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>k</code> - the configuation parameter</dd>
<dd><code>pmf</code> - 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.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>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.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html" title="class in com.yahoo.sketches.kll"><code>KllFloatsSketch</code></a></dd>
</dl>
</li>
</ul>
<a name="getKFromEpsilon-double-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getKFromEpsilon</h4>
<pre>public static&nbsp;int&nbsp;getKFromEpsilon(double&nbsp;epsilon,
boolean&nbsp;pmf)</pre>
<div class="block">Gets the approximate value of <em>k</em> to use given epsilon, the normalized rank error.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>epsilon</code> - the normalized rank error between zero and one.</dd>
<dd><code>pmf</code> - if true, this function returns the value of <em>k</em> assuming the input epsilon
is the desired "double-sided" epsilon for the getPMF() function. Otherwise, this function
returns the value of <em>k</em> assuming the input epsilon is the desired "single-sided"
epsilon for all the other queries.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the value of <i>k</i> given a value of epsilon.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html" title="class in com.yahoo.sketches.kll"><code>KllFloatsSketch</code></a></dd>
</dl>
</li>
</ul>
<a name="getSerializedSizeBytes--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSerializedSizeBytes</h4>
<pre>public&nbsp;int&nbsp;getSerializedSizeBytes()</pre>
<div class="block">Returns the number of bytes this sketch would require to store.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the number of bytes this sketch would require to store.</dd>
</dl>
</li>
</ul>
<a name="getMaxSerializedSizeBytes-int-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxSerializedSizeBytes</h4>
<pre>public static&nbsp;int&nbsp;getMaxSerializedSizeBytes(int&nbsp;k,
long&nbsp;n)</pre>
<div class="block">Returns upper bound on the serialized size of a sketch given a parameter <em>k</em> and stream
length. The resulting size is an overestimate to make sure actual sketches don't exceed it.
This method can be used if allocation of storage is necessary beforehand, but it is not
optimal.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>k</code> - parameter that controls size of the sketch and accuracy of estimates</dd>
<dd><code>n</code> - stream length</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>upper bound on the serialized size</dd>
</dl>
</li>
</ul>
<a name="toString--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;toString()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
</dl>
</li>
</ul>
<a name="toString-boolean-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;toString(boolean&nbsp;withLevels,
boolean&nbsp;withData)</pre>
<div class="block">Returns a summary of the sketch as a string.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>withLevels</code> - if true include information about levels</dd>
<dd><code>withData</code> - if true include sketch data</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>string representation of sketch summary</dd>
</dl>
</li>
</ul>
<a name="toByteArray--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toByteArray</h4>
<pre>public&nbsp;byte[]&nbsp;toByteArray()</pre>
<div class="block">Returns serialized sketch in a byte array form.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>serialized sketch in a byte array form.</dd>
</dl>
</li>
</ul>
<a name="heapify-com.yahoo.memory.Memory-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>heapify</h4>
<pre>public static&nbsp;<a href="../../../../com/yahoo/sketches/kll/KllFloatsSketch.html" title="class in com.yahoo.sketches.kll">KllFloatsSketch</a>&nbsp;heapify(com.yahoo.memory.Memory&nbsp;mem)</pre>
<div class="block">Heapify takes the sketch image in Memory and instantiates an on-heap sketch.
The resulting sketch will not retain any link to the source Memory.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>mem</code> - a Memory image of a sketch.
<a href="../../../../resources/dictionary.html#mem">See Memory</a></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a heap-based sketch based on the given Memory</dd>
</dl>
</li>
</ul>
<a name="iterator--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>iterator</h4>
<pre>public&nbsp;<a href="../../../../com/yahoo/sketches/kll/KllFloatsSketchIterator.html" title="class in com.yahoo.sketches.kll">KllFloatsSketchIterator</a>&nbsp;iterator()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/KllFloatsSketch.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev&nbsp;Class</li>
<li><a href="../../../../com/yahoo/sketches/kll/KllFloatsSketchIterator.html" title="class in com.yahoo.sketches.kll"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/yahoo/sketches/kll/KllFloatsSketch.html" target="_top">Frames</a></li>
<li><a href="KllFloatsSketch.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2015&#x2013;2018. All rights reserved.</small></p>
</body>
</html>