blob: 40f907310a14b2875bb976bb1236c4ea3997f75f [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>datasketches-cpp: quantiles_sketch&lt; T, Comparator, Allocator &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">datasketches-cpp
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacedatasketches.html">datasketches</a></li><li class="navelem"><a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classdatasketches_1_1quantiles__sketch-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">quantiles_sketch&lt; T, Comparator, Allocator &gt; Class Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>This is a stochastic streaming sketch that enables near-real time analysis of the approximate distribution from a very large stream in a single pass.
<a href="classdatasketches_1_1quantiles__sketch.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="quantiles__sketch_8hpp_source.html">quantiles_sketch.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a19c140a63e6b0d34f4354c41d93e5e6c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a19c140a63e6b0d34f4354c41d93e5e6c">quantiles_sketch</a> (uint16_t k=<a class="el" href="namespacedatasketches_1_1quantiles__constants.html#ac8602cb1bd28fc26ae74b484e81a9a52">quantiles_constants::DEFAULT_K</a>, const Comparator &amp;comparator=Comparator(), const Allocator &amp;allocator=Allocator())</td></tr>
<tr class="memdesc:a19c140a63e6b0d34f4354c41d93e5e6c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <a href="classdatasketches_1_1quantiles__sketch.html#a19c140a63e6b0d34f4354c41d93e5e6c">More...</a><br /></td></tr>
<tr class="separator:a19c140a63e6b0d34f4354c41d93e5e6c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a391bae83eaddd8b3b0828da495c23164"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a391bae83eaddd8b3b0828da495c23164">quantiles_sketch</a> (const <a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a> &amp;other)</td></tr>
<tr class="memdesc:a391bae83eaddd8b3b0828da495c23164"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy constructor. <a href="classdatasketches_1_1quantiles__sketch.html#a391bae83eaddd8b3b0828da495c23164">More...</a><br /></td></tr>
<tr class="separator:a391bae83eaddd8b3b0828da495c23164"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a29ce336cb446c2bbdc2f2c1e1a01f171"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a29ce336cb446c2bbdc2f2c1e1a01f171">quantiles_sketch</a> (<a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a> &amp;&amp;other) noexcept</td></tr>
<tr class="memdesc:a29ce336cb446c2bbdc2f2c1e1a01f171"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move constructor. <a href="classdatasketches_1_1quantiles__sketch.html#a29ce336cb446c2bbdc2f2c1e1a01f171">More...</a><br /></td></tr>
<tr class="separator:a29ce336cb446c2bbdc2f2c1e1a01f171"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1aeede739283c1ead07288c1022e5d1b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a1aeede739283c1ead07288c1022e5d1b">operator=</a> (const <a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a> &amp;other)</td></tr>
<tr class="memdesc:a1aeede739283c1ead07288c1022e5d1b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy assignment. <a href="classdatasketches_1_1quantiles__sketch.html#a1aeede739283c1ead07288c1022e5d1b">More...</a><br /></td></tr>
<tr class="separator:a1aeede739283c1ead07288c1022e5d1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae5f3c26a534b7396dd4444e2b2c5c7ec"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#ae5f3c26a534b7396dd4444e2b2c5c7ec">operator=</a> (<a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a> &amp;&amp;other) noexcept</td></tr>
<tr class="memdesc:ae5f3c26a534b7396dd4444e2b2c5c7ec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move assignment. <a href="classdatasketches_1_1quantiles__sketch.html#ae5f3c26a534b7396dd4444e2b2c5c7ec">More...</a><br /></td></tr>
<tr class="separator:ae5f3c26a534b7396dd4444e2b2c5c7ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aebff865d9a4828eb346de6be97135bdc"><td class="memTemplParams" colspan="2">template&lt;typename From , typename FC , typename FA &gt; </td></tr>
<tr class="memitem:aebff865d9a4828eb346de6be97135bdc"><td class="memTemplItemLeft" align="right" valign="top">&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#aebff865d9a4828eb346de6be97135bdc">quantiles_sketch</a> (const <a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a>&lt; From, FC, FA &gt; &amp;other, const Comparator &amp;comparator=Comparator(), const Allocator &amp;allocator=Allocator())</td></tr>
<tr class="memdesc:aebff865d9a4828eb346de6be97135bdc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Type converting constructor. <a href="classdatasketches_1_1quantiles__sketch.html#aebff865d9a4828eb346de6be97135bdc">More...</a><br /></td></tr>
<tr class="separator:aebff865d9a4828eb346de6be97135bdc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5200c74c52ee0f76d0d34c1ca6aec65c"><td class="memTemplParams" colspan="2">template&lt;typename FwdT &gt; </td></tr>
<tr class="memitem:a5200c74c52ee0f76d0d34c1ca6aec65c"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a5200c74c52ee0f76d0d34c1ca6aec65c">update</a> (FwdT &amp;&amp;item)</td></tr>
<tr class="memdesc:a5200c74c52ee0f76d0d34c1ca6aec65c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates this sketch with the given data item. <a href="classdatasketches_1_1quantiles__sketch.html#a5200c74c52ee0f76d0d34c1ca6aec65c">More...</a><br /></td></tr>
<tr class="separator:a5200c74c52ee0f76d0d34c1ca6aec65c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a49bb19e78f36fb72b8496cd6cff71fec"><td class="memTemplParams" colspan="2">template&lt;typename FwdSk &gt; </td></tr>
<tr class="memitem:a49bb19e78f36fb72b8496cd6cff71fec"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a49bb19e78f36fb72b8496cd6cff71fec">merge</a> (FwdSk &amp;&amp;other)</td></tr>
<tr class="memdesc:a49bb19e78f36fb72b8496cd6cff71fec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Merges another sketch into this one. <a href="classdatasketches_1_1quantiles__sketch.html#a49bb19e78f36fb72b8496cd6cff71fec">More...</a><br /></td></tr>
<tr class="separator:a49bb19e78f36fb72b8496cd6cff71fec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5a2b7a58dc85678d08752945ff655362"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a5a2b7a58dc85678d08752945ff655362">is_empty</a> () const</td></tr>
<tr class="memdesc:a5a2b7a58dc85678d08752945ff655362"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if this sketch is empty. <a href="classdatasketches_1_1quantiles__sketch.html#a5a2b7a58dc85678d08752945ff655362">More...</a><br /></td></tr>
<tr class="separator:a5a2b7a58dc85678d08752945ff655362"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59f4c39b9f2e762e8e3445ef89e1d264"><td class="memItemLeft" align="right" valign="top">uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a59f4c39b9f2e762e8e3445ef89e1d264">get_k</a> () const</td></tr>
<tr class="memdesc:a59f4c39b9f2e762e8e3445ef89e1d264"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns configured parameter k. <a href="classdatasketches_1_1quantiles__sketch.html#a59f4c39b9f2e762e8e3445ef89e1d264">More...</a><br /></td></tr>
<tr class="separator:a59f4c39b9f2e762e8e3445ef89e1d264"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af857be9469a7565252626f27e1f9d74d"><td class="memItemLeft" align="right" valign="top">uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#af857be9469a7565252626f27e1f9d74d">get_n</a> () const</td></tr>
<tr class="memdesc:af857be9469a7565252626f27e1f9d74d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the length of the input stream. <a href="classdatasketches_1_1quantiles__sketch.html#af857be9469a7565252626f27e1f9d74d">More...</a><br /></td></tr>
<tr class="separator:af857be9469a7565252626f27e1f9d74d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a31fa76458d81a17dbebfcb828e531f14"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a31fa76458d81a17dbebfcb828e531f14">get_num_retained</a> () const</td></tr>
<tr class="memdesc:a31fa76458d81a17dbebfcb828e531f14"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of retained items (samples) in the sketch. <a href="classdatasketches_1_1quantiles__sketch.html#a31fa76458d81a17dbebfcb828e531f14">More...</a><br /></td></tr>
<tr class="separator:a31fa76458d81a17dbebfcb828e531f14"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae95a04b1d7dccb3d9b3f3c3d087aa8e6"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#ae95a04b1d7dccb3d9b3f3c3d087aa8e6">is_estimation_mode</a> () const</td></tr>
<tr class="memdesc:ae95a04b1d7dccb3d9b3f3c3d087aa8e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if this sketch is in estimation mode. <a href="classdatasketches_1_1quantiles__sketch.html#ae95a04b1d7dccb3d9b3f3c3d087aa8e6">More...</a><br /></td></tr>
<tr class="separator:ae95a04b1d7dccb3d9b3f3c3d087aa8e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af2fa890815acf3a1418ea8eee466075c"><td class="memItemLeft" align="right" valign="top">const T &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#af2fa890815acf3a1418ea8eee466075c">get_min_item</a> () const</td></tr>
<tr class="memdesc:af2fa890815acf3a1418ea8eee466075c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the min item of the stream. <a href="classdatasketches_1_1quantiles__sketch.html#af2fa890815acf3a1418ea8eee466075c">More...</a><br /></td></tr>
<tr class="separator:af2fa890815acf3a1418ea8eee466075c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a687ed2123bdc7e67fbda0c081e3acf21"><td class="memItemLeft" align="right" valign="top">const T &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a687ed2123bdc7e67fbda0c081e3acf21">get_max_item</a> () const</td></tr>
<tr class="memdesc:a687ed2123bdc7e67fbda0c081e3acf21"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the max item of the stream. <a href="classdatasketches_1_1quantiles__sketch.html#a687ed2123bdc7e67fbda0c081e3acf21">More...</a><br /></td></tr>
<tr class="separator:a687ed2123bdc7e67fbda0c081e3acf21"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a076f89979daa6471a3868cb97ea99b40"><td class="memItemLeft" align="right" valign="top">Comparator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a076f89979daa6471a3868cb97ea99b40">get_comparator</a> () const</td></tr>
<tr class="memdesc:a076f89979daa6471a3868cb97ea99b40"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns an instance of the comparator for this sketch. <a href="classdatasketches_1_1quantiles__sketch.html#a076f89979daa6471a3868cb97ea99b40">More...</a><br /></td></tr>
<tr class="separator:a076f89979daa6471a3868cb97ea99b40"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d85cf47c4ecd0580ec623c42006dd1b"><td class="memItemLeft" align="right" valign="top">allocator_type&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a9d85cf47c4ecd0580ec623c42006dd1b">get_allocator</a> () const</td></tr>
<tr class="memdesc:a9d85cf47c4ecd0580ec623c42006dd1b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the allocator for this sketch. <a href="classdatasketches_1_1quantiles__sketch.html#a9d85cf47c4ecd0580ec623c42006dd1b">More...</a><br /></td></tr>
<tr class="separator:a9d85cf47c4ecd0580ec623c42006dd1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac02fcfb6e706148458a2ef89390223a9"><td class="memItemLeft" align="right" valign="top">quantile_return_type&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#ac02fcfb6e706148458a2ef89390223a9">get_quantile</a> (double rank, bool inclusive=true) const</td></tr>
<tr class="memdesc:ac02fcfb6e706148458a2ef89390223a9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns an approximation to the data item associated with the given rank of a hypothetical sorted version of the input stream so far. <a href="classdatasketches_1_1quantiles__sketch.html#ac02fcfb6e706148458a2ef89390223a9">More...</a><br /></td></tr>
<tr class="separator:ac02fcfb6e706148458a2ef89390223a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a849dfa06c183fd2fdfe4fe4a7e29d918"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a849dfa06c183fd2fdfe4fe4a7e29d918">get_rank</a> (const T &amp;item, bool inclusive=true) const</td></tr>
<tr class="memdesc:a849dfa06c183fd2fdfe4fe4a7e29d918"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns an approximation to the normalized rank of the given item from 0 to 1, inclusive. <a href="classdatasketches_1_1quantiles__sketch.html#a849dfa06c183fd2fdfe4fe4a7e29d918">More...</a><br /></td></tr>
<tr class="separator:a849dfa06c183fd2fdfe4fe4a7e29d918"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44226b755e73883ea2c128876e35b1d1"><td class="memItemLeft" align="right" valign="top">vector_double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a44226b755e73883ea2c128876e35b1d1">get_PMF</a> (const T *split_points, uint32_t size, bool inclusive=true) const</td></tr>
<tr class="memdesc:a44226b755e73883ea2c128876e35b1d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns an approximation to the Probability Mass Function (PMF) of the input stream given a set of split points (items). <a href="classdatasketches_1_1quantiles__sketch.html#a44226b755e73883ea2c128876e35b1d1">More...</a><br /></td></tr>
<tr class="separator:a44226b755e73883ea2c128876e35b1d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a20a4d992209b2aa58614c998d143705c"><td class="memItemLeft" align="right" valign="top">vector_double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a20a4d992209b2aa58614c998d143705c">get_CDF</a> (const T *split_points, uint32_t size, bool inclusive=true) const</td></tr>
<tr class="memdesc:a20a4d992209b2aa58614c998d143705c"><td class="mdescLeft">&#160;</td><td class="mdescRight">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 split points (items). <a href="classdatasketches_1_1quantiles__sketch.html#a20a4d992209b2aa58614c998d143705c">More...</a><br /></td></tr>
<tr class="separator:a20a4d992209b2aa58614c998d143705c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad9a5259d93d148b5c2050d68e7788716"><td class="memTemplParams" colspan="2">template&lt;typename SerDe = serde&lt;T&gt;, typename TT = T, typename std::enable_if&lt; std::is_arithmetic&lt; TT &gt;::value, int &gt;::type = 0&gt; </td></tr>
<tr class="memitem:ad9a5259d93d148b5c2050d68e7788716"><td class="memTemplItemLeft" align="right" valign="top">size_t&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#ad9a5259d93d148b5c2050d68e7788716">get_serialized_size_bytes</a> (const SerDe &amp;sd=SerDe()) const</td></tr>
<tr class="memdesc:ad9a5259d93d148b5c2050d68e7788716"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes size needed to serialize the current state of the sketch. <a href="classdatasketches_1_1quantiles__sketch.html#ad9a5259d93d148b5c2050d68e7788716">More...</a><br /></td></tr>
<tr class="separator:ad9a5259d93d148b5c2050d68e7788716"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad9a5259d93d148b5c2050d68e7788716"><td class="memTemplParams" colspan="2">template&lt;typename SerDe = serde&lt;T&gt;, typename TT = T, typename std::enable_if&lt;!std::is_arithmetic&lt; TT &gt;::value, int &gt;::type = 0&gt; </td></tr>
<tr class="memitem:ad9a5259d93d148b5c2050d68e7788716"><td class="memTemplItemLeft" align="right" valign="top">size_t&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#ad9a5259d93d148b5c2050d68e7788716">get_serialized_size_bytes</a> (const SerDe &amp;sd=SerDe()) const</td></tr>
<tr class="memdesc:ad9a5259d93d148b5c2050d68e7788716"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes size needed to serialize the current state of the sketch. <a href="classdatasketches_1_1quantiles__sketch.html#ad9a5259d93d148b5c2050d68e7788716">More...</a><br /></td></tr>
<tr class="separator:ad9a5259d93d148b5c2050d68e7788716"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a538940c100e4353b3671ad452d3d3056"><td class="memTemplParams" colspan="2">template&lt;typename SerDe = serde&lt;T&gt;&gt; </td></tr>
<tr class="memitem:a538940c100e4353b3671ad452d3d3056"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a538940c100e4353b3671ad452d3d3056">serialize</a> (std::ostream &amp;os, const SerDe &amp;sd=SerDe()) const</td></tr>
<tr class="memdesc:a538940c100e4353b3671ad452d3d3056"><td class="mdescLeft">&#160;</td><td class="mdescRight">This method serializes the sketch into a given stream in a binary form. <a href="classdatasketches_1_1quantiles__sketch.html#a538940c100e4353b3671ad452d3d3056">More...</a><br /></td></tr>
<tr class="separator:a538940c100e4353b3671ad452d3d3056"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d0c269c23926e93b1c7a9c00e86af97"><td class="memTemplParams" colspan="2">template&lt;typename SerDe = serde&lt;T&gt;&gt; </td></tr>
<tr class="memitem:a1d0c269c23926e93b1c7a9c00e86af97"><td class="memTemplItemLeft" align="right" valign="top">vector_bytes&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a1d0c269c23926e93b1c7a9c00e86af97">serialize</a> (unsigned header_size_bytes=0, const SerDe &amp;sd=SerDe()) const</td></tr>
<tr class="memdesc:a1d0c269c23926e93b1c7a9c00e86af97"><td class="mdescLeft">&#160;</td><td class="mdescRight">This method serializes the sketch as a vector of bytes. <a href="classdatasketches_1_1quantiles__sketch.html#a1d0c269c23926e93b1c7a9c00e86af97">More...</a><br /></td></tr>
<tr class="separator:a1d0c269c23926e93b1c7a9c00e86af97"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3efad6c7f1aa59649203cc9f70cf36c9"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a3efad6c7f1aa59649203cc9f70cf36c9">get_normalized_rank_error</a> (bool is_pmf) const</td></tr>
<tr class="memdesc:a3efad6c7f1aa59649203cc9f70cf36c9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the normalized rank error for this sketch. <a href="classdatasketches_1_1quantiles__sketch.html#a3efad6c7f1aa59649203cc9f70cf36c9">More...</a><br /></td></tr>
<tr class="separator:a3efad6c7f1aa59649203cc9f70cf36c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a592a7af55659ff803b26a45552a68dda"><td class="memItemLeft" align="right" valign="top">string&lt; Allocator &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a592a7af55659ff803b26a45552a68dda">to_string</a> (bool print_levels=false, bool print_items=false) const</td></tr>
<tr class="memdesc:a592a7af55659ff803b26a45552a68dda"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints a summary of the sketch. <a href="classdatasketches_1_1quantiles__sketch.html#a592a7af55659ff803b26a45552a68dda">More...</a><br /></td></tr>
<tr class="separator:a592a7af55659ff803b26a45552a68dda"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5337e7ce1f6a4ebcef233caf3e24c01"><td class="memItemLeft" align="right" valign="top">const_iterator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#ac5337e7ce1f6a4ebcef233caf3e24c01">begin</a> () const</td></tr>
<tr class="memdesc:ac5337e7ce1f6a4ebcef233caf3e24c01"><td class="mdescLeft">&#160;</td><td class="mdescRight">Iterator pointing to the first item in the sketch. <a href="classdatasketches_1_1quantiles__sketch.html#ac5337e7ce1f6a4ebcef233caf3e24c01">More...</a><br /></td></tr>
<tr class="separator:ac5337e7ce1f6a4ebcef233caf3e24c01"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af3d8f736304ab5d51319c00febfc0ad1"><td class="memItemLeft" align="right" valign="top">const_iterator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#af3d8f736304ab5d51319c00febfc0ad1">end</a> () const</td></tr>
<tr class="memdesc:af3d8f736304ab5d51319c00febfc0ad1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Iterator pointing to the past-the-end item in the sketch. <a href="classdatasketches_1_1quantiles__sketch.html#af3d8f736304ab5d51319c00febfc0ad1">More...</a><br /></td></tr>
<tr class="separator:af3d8f736304ab5d51319c00febfc0ad1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a9c9c240dd591017fd6a80e147b7c00"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classdatasketches_1_1quantiles__sorted__view.html">quantiles_sorted_view</a>&lt; T, Comparator, Allocator &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a0a9c9c240dd591017fd6a80e147b7c00">get_sorted_view</a> () const</td></tr>
<tr class="memdesc:a0a9c9c240dd591017fd6a80e147b7c00"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the sorted view of this sketch. <a href="classdatasketches_1_1quantiles__sketch.html#a0a9c9c240dd591017fd6a80e147b7c00">More...</a><br /></td></tr>
<tr class="separator:a0a9c9c240dd591017fd6a80e147b7c00"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a7350b4a67bcf6081017e1c42eef920d4"><td class="memTemplParams" colspan="2">template&lt;typename SerDe = serde&lt;T&gt;&gt; </td></tr>
<tr class="memitem:a7350b4a67bcf6081017e1c42eef920d4"><td class="memTemplItemLeft" align="right" valign="top">static <a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a>&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a7350b4a67bcf6081017e1c42eef920d4">deserialize</a> (std::istream &amp;is, const SerDe &amp;sd=SerDe(), const Comparator &amp;comparator=Comparator(), const Allocator &amp;allocator=Allocator())</td></tr>
<tr class="memdesc:a7350b4a67bcf6081017e1c42eef920d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">This method deserializes a sketch from a given stream. <a href="classdatasketches_1_1quantiles__sketch.html#a7350b4a67bcf6081017e1c42eef920d4">More...</a><br /></td></tr>
<tr class="separator:a7350b4a67bcf6081017e1c42eef920d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a84d709e8662d6467f0565bda59ee9f61"><td class="memTemplParams" colspan="2">template&lt;typename SerDe = serde&lt;T&gt;&gt; </td></tr>
<tr class="memitem:a84d709e8662d6467f0565bda59ee9f61"><td class="memTemplItemLeft" align="right" valign="top">static <a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a>&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#a84d709e8662d6467f0565bda59ee9f61">deserialize</a> (const void *bytes, size_t size, const SerDe &amp;sd=SerDe(), const Comparator &amp;comparator=Comparator(), const Allocator &amp;allocator=Allocator())</td></tr>
<tr class="memdesc:a84d709e8662d6467f0565bda59ee9f61"><td class="mdescLeft">&#160;</td><td class="mdescRight">This method deserializes a sketch from a given array of bytes. <a href="classdatasketches_1_1quantiles__sketch.html#a84d709e8662d6467f0565bda59ee9f61">More...</a><br /></td></tr>
<tr class="separator:a84d709e8662d6467f0565bda59ee9f61"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae957f61cebc92305fc758dcfad797a41"><td class="memItemLeft" align="right" valign="top">static double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdatasketches_1_1quantiles__sketch.html#ae957f61cebc92305fc758dcfad797a41">get_normalized_rank_error</a> (uint16_t k, bool is_pmf)</td></tr>
<tr class="memdesc:ae957f61cebc92305fc758dcfad797a41"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the normalized rank error given k and pmf. <a href="classdatasketches_1_1quantiles__sketch.html#ae957f61cebc92305fc758dcfad797a41">More...</a><br /></td></tr>
<tr class="separator:ae957f61cebc92305fc758dcfad797a41"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename T, typename Comparator = std::less&lt;T&gt;, typename Allocator = std::allocator&lt;T&gt;&gt;<br />
class datasketches::quantiles_sketch&lt; T, Comparator, Allocator &gt;</h3>
<p>This is a stochastic streaming sketch that enables near-real time analysis of the approximate distribution from a very large stream in a single pass. </p>
<p>The analysis is obtained using <a class="el" href="classdatasketches_1_1quantiles__sketch.html#a849dfa06c183fd2fdfe4fe4a7e29d918" title="Returns an approximation to the normalized rank of the given item from 0 to 1, inclusive.">get_rank()</a> and <a class="el" href="classdatasketches_1_1quantiles__sketch.html#ac02fcfb6e706148458a2ef89390223a9" title="Returns an approximation to the data item associated with the given rank of a hypothetical sorted ver...">get_quantile()</a> functions, the Probability Mass Function from <a class="el" href="classdatasketches_1_1quantiles__sketch.html#a44226b755e73883ea2c128876e35b1d1" title="Returns an approximation to the Probability Mass Function (PMF) of the input stream given a set of sp...">get_PMF()</a> and the Cumulative Distribution Function from <a class="el" href="classdatasketches_1_1quantiles__sketch.html#a20a4d992209b2aa58614c998d143705c" title="Returns an approximation to the Cumulative Distribution Function (CDF), which is the cumulative analo...">get_CDF()</a>.</p>
<p>Consider a large stream of one million values such as packet sizes coming into a network node. The natural rank of any specific size value is its index in the hypothetical sorted array of values. The normalized rank is the natural rank divided by the stream size, in this case one million. The value corresponding to the normalized rank of 0.5 represents the 50th percentile or median value of the distribution, or get_quantile(0.5). Similarly, the 95th percentile is obtained from get_quantile(0.95).</p>
<p>From the min and max values, for example, 1 and 1000 bytes, you can obtain the PMF from get_PMF(100, 500, 900) that will result in an array of 4 fractional values such as {.4, .3, .2, .1}, which means that </p><ul>
<li>
40% of the values were &lt; 100, </li>
<li>
30% of the values were &ge; 100 and &lt; 500, </li>
<li>
20% of the values were &ge; 500 and &lt; 900, and </li>
<li>
10% of the values were &ge; 900. </li>
</ul>
<p>A frequency histogram can be obtained by multiplying these fractions by <a class="el" href="classdatasketches_1_1quantiles__sketch.html#af857be9469a7565252626f27e1f9d74d" title="Returns the length of the input stream.">get_n()</a>, which is the total count of values received. The <a class="el" href="classdatasketches_1_1quantiles__sketch.html#a20a4d992209b2aa58614c998d143705c" title="Returns an approximation to the Cumulative Distribution Function (CDF), which is the cumulative analo...">get_CDF()</a> works similarly, but produces the cumulative distribution instead.</p>
<p>As of November 2021, this implementation produces serialized sketches which are binary-compatible with the equivalent Java implementation only when template parameter T = double (64-bit double precision values).</p>
<p>The accuracy of this sketch is a function of the configured value <em>k</em>, which also affects the overall size of the sketch. Accuracy of this quantile sketch is always with respect to the normalized rank. A <em>k</em> of 128 produces a normalized, rank error of about 1.7%. For example, the median item returned from getQuantile(0.5) will be between the actual items from the hypothetically sorted array of input items at normalized ranks of 0.483 and 0.517, with a confidence of about 99%.</p>
<pre>
Table Guide for DoublesSketch Size in Bytes and Approximate Error:
K =&gt; | 16 32 64 128 256 512 1,024
~ Error =&gt; | 12.145% 6.359% 3.317% 1.725% 0.894% 0.463% 0.239%
N | Size in Bytes -&gt;
------------------------------------------------------------------------
0 | 8 8 8 8 8 8 8
1 | 72 72 72 72 72 72 72
3 | 72 72 72 72 72 72 72
7 | 104 104 104 104 104 104 104
15 | 168 168 168 168 168 168 168
31 | 296 296 296 296 296 296 296
63 | 424 552 552 552 552 552 552
127 | 552 808 1,064 1,064 1,064 1,064 1,064
255 | 680 1,064 1,576 2,088 2,088 2,088 2,088
511 | 808 1,320 2,088 3,112 4,136 4,136 4,136
1,023 | 936 1,576 2,600 4,136 6,184 8,232 8,232
2,047 | 1,064 1,832 3,112 5,160 8,232 12,328 16,424
4,095 | 1,192 2,088 3,624 6,184 10,280 16,424 24,616
8,191 | 1,320 2,344 4,136 7,208 12,328 20,520 32,808
16,383 | 1,448 2,600 4,648 8,232 14,376 24,616 41,000
32,767 | 1,576 2,856 5,160 9,256 16,424 28,712 49,192
65,535 | 1,704 3,112 5,672 10,280 18,472 32,808 57,384
131,071 | 1,832 3,368 6,184 11,304 20,520 36,904 65,576
262,143 | 1,960 3,624 6,696 12,328 22,568 41,000 73,768
524,287 | 2,088 3,880 7,208 13,352 24,616 45,096 81,960
1,048,575 | 2,216 4,136 7,720 14,376 26,664 49,192 90,152
2,097,151 | 2,344 4,392 8,232 15,400 28,712 53,288 98,344
4,194,303 | 2,472 4,648 8,744 16,424 30,760 57,384 106,536
8,388,607 | 2,600 4,904 9,256 17,448 32,808 61,480 114,728
16,777,215 | 2,728 5,160 9,768 18,472 34,856 65,576 122,920
33,554,431 | 2,856 5,416 10,280 19,496 36,904 69,672 131,112
67,108,863 | 2,984 5,672 10,792 20,520 38,952 73,768 139,304
134,217,727 | 3,112 5,928 11,304 21,544 41,000 77,864 147,496
268,435,455 | 3,240 6,184 11,816 22,568 43,048 81,960 155,688
536,870,911 | 3,368 6,440 12,328 23,592 45,096 86,056 163,880
1,073,741,823 | 3,496 6,696 12,840 24,616 47,144 90,152 172,072
2,147,483,647 | 3,624 6,952 13,352 25,640 49,192 94,248 180,264
4,294,967,295 | 3,752 7,208 13,864 26,664 51,240 98,344 188,456
</pre><p>There is more documentation available on <a href="https://datasketches.apache.org">datasketches.apache.org</a>.</p>
<p>This is an implementation of the Low Discrepancy Mergeable Quantiles Sketch described in section 3.2 of the journal version of the paper "Mergeable Summaries" by Agarwal, Cormode, Huang, Phillips, Wei, and Yi. <a href="http://dblp.org/rec/html/journals/tods/AgarwalCHPWY13"></a></p>
<p>This algorithm is independent of the distribution of items and requires only that the items be comparable.</p>
<p>This algorithm intentionally inserts randomness into the sampling process for items that ultimately get retained in the sketch. The results produced by this algorithm are not deterministic. For example, if the same stream is inserted into two different instances of this sketch, the answers obtained from the two sketches may not be identical.</p>
<p>Similarly, there may be directional inconsistencies. For example, the result obtained from get_quantile(rank) input into the reverse directional query get_rank(item) may not result in the original item.</p>
<dl class="section author"><dt>Author</dt><dd>Kevin Lang </dd>
<dd>
Lee Rhodes </dd>
<dd>
Alexander Saydakov </dd>
<dd>
Jon Malkin </dd></dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a19c140a63e6b0d34f4354c41d93e5e6c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a19c140a63e6b0d34f4354c41d93e5e6c">&#9670;&nbsp;</a></span>quantiles_sketch() <span class="overload">[1/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a> </td>
<td>(</td>
<td class="paramtype">uint16_t&#160;</td>
<td class="paramname"><em>k</em> = <code><a class="el" href="namespacedatasketches_1_1quantiles__constants.html#ac8602cb1bd28fc26ae74b484e81a9a52">quantiles_constants::DEFAULT_K</a></code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const Comparator &amp;&#160;</td>
<td class="paramname"><em>comparator</em> = <code>Comparator()</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const Allocator &amp;&#160;</td>
<td class="paramname"><em>allocator</em> = <code>Allocator()</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">k</td><td>affects the size of the sketch and its estimation error </td></tr>
<tr><td class="paramname">comparator</td><td>strict weak ordering function (see C++ named requirements: Compare) </td></tr>
<tr><td class="paramname">allocator</td><td>used to allocate memory </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a391bae83eaddd8b3b0828da495c23164"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a391bae83eaddd8b3b0828da495c23164">&#9670;&nbsp;</a></span>quantiles_sketch() <span class="overload">[2/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a>&lt; T, Comparator, Allocator &gt; &amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Copy constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">other</td><td>sketch to be copied </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a29ce336cb446c2bbdc2f2c1e1a01f171"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a29ce336cb446c2bbdc2f2c1e1a01f171">&#9670;&nbsp;</a></span>quantiles_sketch() <span class="overload">[3/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a>&lt; T, Comparator, Allocator &gt; &amp;&amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Move constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">other</td><td>sketch to be moved </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="aebff865d9a4828eb346de6be97135bdc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aebff865d9a4828eb346de6be97135bdc">&#9670;&nbsp;</a></span>quantiles_sketch() <span class="overload">[4/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a>&lt; From, FC, FA &gt; &amp;&#160;</td>
<td class="paramname"><em>other</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const Comparator &amp;&#160;</td>
<td class="paramname"><em>comparator</em> = <code>Comparator()</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const Allocator &amp;&#160;</td>
<td class="paramname"><em>allocator</em> = <code>Allocator()</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Type converting constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">other</td><td>quantiles sketch of a different type </td></tr>
<tr><td class="paramname">comparator</td><td>instance of a Comparator </td></tr>
<tr><td class="paramname">allocator</td><td>instance of an Allocator </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a1aeede739283c1ead07288c1022e5d1b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1aeede739283c1ead07288c1022e5d1b">&#9670;&nbsp;</a></span>operator=() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a>&lt; T, C, A &gt; &amp; operator= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a>&lt; T, Comparator, Allocator &gt; &amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Copy assignment. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">other</td><td>sketch to be copied </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>reference to this sketch </dd></dl>
</div>
</div>
<a id="ae5f3c26a534b7396dd4444e2b2c5c7ec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae5f3c26a534b7396dd4444e2b2c5c7ec">&#9670;&nbsp;</a></span>operator=() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a>&lt; T, C, A &gt; &amp; operator= </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a>&lt; T, Comparator, Allocator &gt; &amp;&amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Move assignment. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">other</td><td>sketch to be moved </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>reference to this sketch </dd></dl>
</div>
</div>
<a id="a5200c74c52ee0f76d0d34c1ca6aec65c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5200c74c52ee0f76d0d34c1ca6aec65c">&#9670;&nbsp;</a></span>update()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void update </td>
<td>(</td>
<td class="paramtype">FwdT &amp;&amp;&#160;</td>
<td class="paramname"><em>item</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Updates this sketch with the given data item. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">item</td><td>from a stream of items </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a49bb19e78f36fb72b8496cd6cff71fec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a49bb19e78f36fb72b8496cd6cff71fec">&#9670;&nbsp;</a></span>merge()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void merge </td>
<td>(</td>
<td class="paramtype">FwdSk &amp;&amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Merges another sketch into this one. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">other</td><td>sketch to merge into this one </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a5a2b7a58dc85678d08752945ff655362"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5a2b7a58dc85678d08752945ff655362">&#9670;&nbsp;</a></span>is_empty()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool is_empty</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns true if this sketch is empty. </p>
<dl class="section return"><dt>Returns</dt><dd>empty flag </dd></dl>
</div>
</div>
<a id="a59f4c39b9f2e762e8e3445ef89e1d264"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a59f4c39b9f2e762e8e3445ef89e1d264">&#9670;&nbsp;</a></span>get_k()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint16_t get_k</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns configured parameter k. </p>
<dl class="section return"><dt>Returns</dt><dd>parameter k </dd></dl>
</div>
</div>
<a id="af857be9469a7565252626f27e1f9d74d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af857be9469a7565252626f27e1f9d74d">&#9670;&nbsp;</a></span>get_n()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint64_t get_n</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the length of the input stream. </p>
<dl class="section return"><dt>Returns</dt><dd>stream length </dd></dl>
</div>
</div>
<a id="a31fa76458d81a17dbebfcb828e531f14"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a31fa76458d81a17dbebfcb828e531f14">&#9670;&nbsp;</a></span>get_num_retained()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint32_t get_num_retained</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the number of retained items (samples) in the sketch. </p>
<dl class="section return"><dt>Returns</dt><dd>the number of retained items </dd></dl>
</div>
</div>
<a id="ae95a04b1d7dccb3d9b3f3c3d087aa8e6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae95a04b1d7dccb3d9b3f3c3d087aa8e6">&#9670;&nbsp;</a></span>is_estimation_mode()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool is_estimation_mode</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns true if this sketch is in estimation mode. </p>
<dl class="section return"><dt>Returns</dt><dd>estimation mode flag </dd></dl>
</div>
</div>
<a id="af2fa890815acf3a1418ea8eee466075c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af2fa890815acf3a1418ea8eee466075c">&#9670;&nbsp;</a></span>get_min_item()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const T &amp; get_min_item</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the min item of the stream. </p>
<p>If the sketch is empty this throws std::runtime_error. </p><dl class="section return"><dt>Returns</dt><dd>the min item of the stream </dd></dl>
</div>
</div>
<a id="a687ed2123bdc7e67fbda0c081e3acf21"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a687ed2123bdc7e67fbda0c081e3acf21">&#9670;&nbsp;</a></span>get_max_item()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const T &amp; get_max_item</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the max item of the stream. </p>
<p>If the sketch is empty this throws std::runtime_error. </p><dl class="section return"><dt>Returns</dt><dd>the max item of the stream </dd></dl>
</div>
</div>
<a id="a076f89979daa6471a3868cb97ea99b40"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a076f89979daa6471a3868cb97ea99b40">&#9670;&nbsp;</a></span>get_comparator()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">C get_comparator</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns an instance of the comparator for this sketch. </p>
<dl class="section return"><dt>Returns</dt><dd>comparator </dd></dl>
</div>
</div>
<a id="a9d85cf47c4ecd0580ec623c42006dd1b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9d85cf47c4ecd0580ec623c42006dd1b">&#9670;&nbsp;</a></span>get_allocator()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">A get_allocator</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the allocator for this sketch. </p>
<dl class="section return"><dt>Returns</dt><dd>allocator </dd></dl>
</div>
</div>
<a id="ac02fcfb6e706148458a2ef89390223a9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac02fcfb6e706148458a2ef89390223a9">&#9670;&nbsp;</a></span>get_quantile()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">auto get_quantile </td>
<td>(</td>
<td class="paramtype">double&#160;</td>
<td class="paramname"><em>rank</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>inclusive</em> = <code>true</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns an approximation to the data item associated with the given rank of a hypothetical sorted version of the input stream so far. </p>
<p>If the sketch is empty this throws std::runtime_error.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">rank</td><td>the specified normalized rank in the hypothetical sorted stream. </td></tr>
<tr><td class="paramname">inclusive</td><td>if true the weight of the given item is included into the rank. Otherwise the rank equals the sum of the weights of all items that are less than the given item according to the Comparator. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the approximation to the item at the given rank </dd></dl>
</div>
</div>
<a id="a849dfa06c183fd2fdfe4fe4a7e29d918"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a849dfa06c183fd2fdfe4fe4a7e29d918">&#9670;&nbsp;</a></span>get_rank()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double get_rank </td>
<td>(</td>
<td class="paramtype">const T &amp;&#160;</td>
<td class="paramname"><em>item</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>inclusive</em> = <code>true</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns an approximation to the normalized rank of the given item from 0 to 1, inclusive. </p>
<p>The resulting approximation has a probabilistic guarantee that can be obtained from the get_normalized_rank_error(false) function.</p>
<p>If the sketch is empty this throws std::runtime_error.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">item</td><td>to be ranked </td></tr>
<tr><td class="paramname">inclusive</td><td>if true the weight of the given item is included into the rank. Otherwise the rank equals the sum of the weights of all items that are less than the given item according to the Comparator. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>an approximate normalized rank of the given item </dd></dl>
</div>
</div>
<a id="a44226b755e73883ea2c128876e35b1d1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a44226b755e73883ea2c128876e35b1d1">&#9670;&nbsp;</a></span>get_PMF()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">auto get_PMF </td>
<td>(</td>
<td class="paramtype">const T *&#160;</td>
<td class="paramname"><em>split_points</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>inclusive</em> = <code>true</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns an approximation to the Probability Mass Function (PMF) of the input stream given a set of split points (items). </p>
<p>The resulting approximations have a probabilistic guarantee that can be obtained from the get_normalized_rank_error(true) function.</p>
<p>If the sketch is empty this throws std::runtime_error.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">split_points</td><td>an array of <em>m</em> unique, monotonically increasing items that divide the input domain into <em>m+1</em> consecutive disjoint intervals (bins).</td></tr>
<tr><td class="paramname">size</td><td>of the array of split points.</td></tr>
<tr><td class="paramname">inclusive</td><td>if true the rank of an item includes its own weight, and therefore if the sketch contains items equal to a slit point, then in PMF such items are included into the interval to the left of split point. Otherwise they are included into the interval to the right of split point.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>an array of m+1 doubles each of which is an approximation to the fraction of the input stream items (the mass) that fall into one of those intervals. </dd></dl>
</div>
</div>
<a id="a20a4d992209b2aa58614c998d143705c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a20a4d992209b2aa58614c998d143705c">&#9670;&nbsp;</a></span>get_CDF()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">auto get_CDF </td>
<td>(</td>
<td class="paramtype">const T *&#160;</td>
<td class="paramname"><em>split_points</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>inclusive</em> = <code>true</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>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 split points (items). </p>
<p>The resulting approximations have a probabilistic guarantee that can be obtained from the get_normalized_rank_error(false) function.</p>
<p>If the sketch is empty this throws std::runtime_error.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">split_points</td><td>an array of <em>m</em> unique, monotonically increasing items that divide the input domain into <em>m+1</em> consecutive disjoint intervals.</td></tr>
<tr><td class="paramname">size</td><td>of the array of split points.</td></tr>
<tr><td class="paramname">inclusive</td><td>if true the rank of an item includes its own weight, and therefore if the sketch contains items equal to a slit point, then in CDF such items are included into the interval to the left of split point. Otherwise they are included into the interval to the right of split point.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>an array of m+1 double values, which are a consecutive approximation to the CDF of the input stream given the split_points. 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. This can be viewed as array of ranks of the given split points plus one more value that is always 1. </dd></dl>
</div>
</div>
<a id="ad9a5259d93d148b5c2050d68e7788716"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad9a5259d93d148b5c2050d68e7788716">&#9670;&nbsp;</a></span>get_serialized_size_bytes() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t get_serialized_size_bytes </td>
<td>(</td>
<td class="paramtype">const SerDe &amp;&#160;</td>
<td class="paramname"><em>sd</em> = <code>SerDe()</code></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes size needed to serialize the current state of the sketch. </p>
<p>This version is for fixed-size arithmetic types (integral and floating point). </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">sd</td><td>instance of a SerDe </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>size in bytes needed to serialize this sketch </dd></dl>
</div>
</div>
<a id="ad9a5259d93d148b5c2050d68e7788716"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad9a5259d93d148b5c2050d68e7788716">&#9670;&nbsp;</a></span>get_serialized_size_bytes() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t get_serialized_size_bytes </td>
<td>(</td>
<td class="paramtype">const SerDe &amp;&#160;</td>
<td class="paramname"><em>sd</em> = <code>SerDe()</code></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes size needed to serialize the current state of the sketch. </p>
<p>This version is for all other types and can be expensive since every item needs to be looked at. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">sd</td><td>instance of a SerDe </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>size in bytes needed to serialize this sketch </dd></dl>
</div>
</div>
<a id="a538940c100e4353b3671ad452d3d3056"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a538940c100e4353b3671ad452d3d3056">&#9670;&nbsp;</a></span>serialize() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void serialize </td>
<td>(</td>
<td class="paramtype">std::ostream &amp;&#160;</td>
<td class="paramname"><em>os</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const SerDe &amp;&#160;</td>
<td class="paramname"><em>sd</em> = <code>SerDe()</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>This method serializes the sketch into a given stream in a binary form. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">os</td><td>output stream </td></tr>
<tr><td class="paramname">sd</td><td>instance of a SerDe </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a1d0c269c23926e93b1c7a9c00e86af97"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1d0c269c23926e93b1c7a9c00e86af97">&#9670;&nbsp;</a></span>serialize() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">vector_bytes serialize </td>
<td>(</td>
<td class="paramtype">unsigned&#160;</td>
<td class="paramname"><em>header_size_bytes</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const SerDe &amp;&#160;</td>
<td class="paramname"><em>sd</em> = <code>SerDe()</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>This method serializes the sketch as a vector of bytes. </p>
<p>An optional header can be reserved in front of the sketch. It is a blank space of a given size. This header is used in Datasketches PostgreSQL extension. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">header_size_bytes</td><td>space to reserve in front of the sketch </td></tr>
<tr><td class="paramname">sd</td><td>instance of a SerDe </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>serialized sketch as a vector of bytes </dd></dl>
</div>
</div>
<a id="a7350b4a67bcf6081017e1c42eef920d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7350b4a67bcf6081017e1c42eef920d4">&#9670;&nbsp;</a></span>deserialize() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a> deserialize </td>
<td>(</td>
<td class="paramtype">std::istream &amp;&#160;</td>
<td class="paramname"><em>is</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const SerDe &amp;&#160;</td>
<td class="paramname"><em>sd</em> = <code>SerDe()</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const Comparator &amp;&#160;</td>
<td class="paramname"><em>comparator</em> = <code>Comparator()</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const Allocator &amp;&#160;</td>
<td class="paramname"><em>allocator</em> = <code>Allocator()</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This method deserializes a sketch from a given stream. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">is</td><td>input stream </td></tr>
<tr><td class="paramname">sd</td><td>instance of a SerDe </td></tr>
<tr><td class="paramname">comparator</td><td>instance of a Comparator </td></tr>
<tr><td class="paramname">allocator</td><td>instance of an Allocator </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>an instance of a sketch </dd></dl>
</div>
</div>
<a id="a84d709e8662d6467f0565bda59ee9f61"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a84d709e8662d6467f0565bda59ee9f61">&#9670;&nbsp;</a></span>deserialize() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a> deserialize </td>
<td>(</td>
<td class="paramtype">const void *&#160;</td>
<td class="paramname"><em>bytes</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const SerDe &amp;&#160;</td>
<td class="paramname"><em>sd</em> = <code>SerDe()</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const Comparator &amp;&#160;</td>
<td class="paramname"><em>comparator</em> = <code>Comparator()</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const Allocator &amp;&#160;</td>
<td class="paramname"><em>allocator</em> = <code>Allocator()</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This method deserializes a sketch from a given array of bytes. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">bytes</td><td>pointer to the array of bytes </td></tr>
<tr><td class="paramname">size</td><td>the size of the array </td></tr>
<tr><td class="paramname">sd</td><td>instance of a SerDe </td></tr>
<tr><td class="paramname">comparator</td><td>instance of a Comparator </td></tr>
<tr><td class="paramname">allocator</td><td>instance of an Allocator </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>an instance of a sketch </dd></dl>
</div>
</div>
<a id="a3efad6c7f1aa59649203cc9f70cf36c9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3efad6c7f1aa59649203cc9f70cf36c9">&#9670;&nbsp;</a></span>get_normalized_rank_error() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double get_normalized_rank_error </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>is_pmf</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Gets the normalized rank error for this sketch. </p>
<p>Constants were derived as the best fit to 99 percentile empirically measured max error in thousands of trials. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">is_pmf</td><td>if true, returns the "double-sided" normalized rank error for the <a class="el" href="classdatasketches_1_1quantiles__sketch.html#a44226b755e73883ea2c128876e35b1d1" title="Returns an approximation to the Probability Mass Function (PMF) of the input stream given a set of sp...">get_PMF()</a> function. Otherwise, it is the "single-sided" normalized rank error for all the other queries. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the normalized rank error for the sketch </dd></dl>
</div>
</div>
<a id="ae957f61cebc92305fc758dcfad797a41"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae957f61cebc92305fc758dcfad797a41">&#9670;&nbsp;</a></span>get_normalized_rank_error() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">double get_normalized_rank_error </td>
<td>(</td>
<td class="paramtype">uint16_t&#160;</td>
<td class="paramname"><em>k</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>is_pmf</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Gets the normalized rank error given k and pmf. </p>
<p>Constants were derived as the best fit to 99 percentile empirically measured max error in thousands of trials. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">k</td><td>the configuration parameter </td></tr>
<tr><td class="paramname">is_pmf</td><td>if true, returns the "double-sided" normalized rank error for the <a class="el" href="classdatasketches_1_1quantiles__sketch.html#a44226b755e73883ea2c128876e35b1d1" title="Returns an approximation to the Probability Mass Function (PMF) of the input stream given a set of sp...">get_PMF()</a> function. Otherwise, it is the "single-sided" normalized rank error for all the other queries. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the normalized rank error for the given parameters </dd></dl>
</div>
</div>
<a id="a592a7af55659ff803b26a45552a68dda"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a592a7af55659ff803b26a45552a68dda">&#9670;&nbsp;</a></span>to_string()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">string&lt; A &gt; to_string </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>print_levels</em> = <code>false</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>print_items</em> = <code>false</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Prints a summary of the sketch. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">print_levels</td><td>if true include information about levels </td></tr>
<tr><td class="paramname">print_items</td><td>if true include sketch data </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ac5337e7ce1f6a4ebcef233caf3e24c01"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac5337e7ce1f6a4ebcef233caf3e24c01">&#9670;&nbsp;</a></span>begin()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a>&lt; T, C, A &gt;::const_iterator begin</td>
</tr>
</table>
</div><div class="memdoc">
<p>Iterator pointing to the first item in the sketch. </p>
<p>If the sketch is empty, the returned iterator must not be dereferenced or incremented. </p><dl class="section return"><dt>Returns</dt><dd>iterator pointing to the first item in the sketch </dd></dl>
</div>
</div>
<a id="af3d8f736304ab5d51319c00febfc0ad1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af3d8f736304ab5d51319c00febfc0ad1">&#9670;&nbsp;</a></span>end()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classdatasketches_1_1quantiles__sketch.html">quantiles_sketch</a>&lt; T, C, A &gt;::const_iterator end</td>
</tr>
</table>
</div><div class="memdoc">
<p>Iterator pointing to the past-the-end item in the sketch. </p>
<p>The past-the-end item is the hypothetical item that would follow the last item. It does not point to any item, and must not be dereferenced or incremented. </p><dl class="section return"><dt>Returns</dt><dd>iterator pointing to the past-the-end item in the sketch </dd></dl>
</div>
</div>
<a id="a0a9c9c240dd591017fd6a80e147b7c00"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0a9c9c240dd591017fd6a80e147b7c00">&#9670;&nbsp;</a></span>get_sorted_view()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classdatasketches_1_1quantiles__sorted__view.html">quantiles_sorted_view</a>&lt; T, C, A &gt; get_sorted_view</td>
</tr>
</table>
</div><div class="memdoc">
<p>Gets the sorted view of this sketch. </p>
<dl class="section return"><dt>Returns</dt><dd>the sorted view of this sketch </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>quantiles/include/<a class="el" href="quantiles__sketch_8hpp_source.html">quantiles_sketch.hpp</a></li>
<li>quantiles/include/<a class="el" href="quantiles__sketch__impl_8hpp_source.html">quantiles_sketch_impl.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>