2
0
mirror of https://github.com/boostorg/gil.git synced 2026-02-10 23:42:13 +00:00
Files
gil/develop/doc/html/histogram/cumulative.html
github-actions[bot] e463c3097c deploy: f9d785a2d5
2026-02-06 18:22:26 +00:00

111 lines
5.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://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/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Making a cumulative histogram - Boost.GIL documentation</title>
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/style.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '.html'
};
</script>
<script type="text/javascript" src="../_static/documentation_options.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/sphinx_highlight.js"></script>
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/searchtools.js"></script>
<script src="../_static/language_data.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="top" title="Boost.GIL documentation" href="../index.html" />
<link rel="up" title="Histogram" href="index.html" />
<link rel="next" title="STL compatibility" href="stl_compatibility.html" />
<link rel="prev" title="Making a sub-histogram" href="subhistogram.html" />
</head>
<body>
<div class="header">
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
"header">
<tr>
<td valign="top" width="300">
<h3><a href="../index.html"><img
alt="C++ Boost" src="../../_static/gil.png" border="0"></a></h3>
</td>
<td >
<h1 align="center"><a href="../index.html"></a></h1>
</td>
<td>
<div id="searchbox" style="display: none">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" size="18" />
<input type="submit" value="Search" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</td>
</tr>
</table>
</div>
<hr/>
<div class="content">
<div class="navbar" style="text-align:right;">
<a class="prev" title="Making a sub-histogram" href="subhistogram.html"><img src="../_static/prev.png" alt="prev"/></a>
<a class="up" title="Histogram" href="index.html"><img src="../_static/up.png" alt="up"/></a>
<a class="next" title="STL compatibility" href="stl_compatibility.html"><img src="../_static/next.png" alt="next"/></a>
</div>
<section id="making-a-cumulative-histogram">
<span id="cumulative-histogram"></span><h1>Making a cumulative histogram<a class="headerlink" href="#making-a-cumulative-histogram" title="Link to this heading"></a></h1>
<section id="overview">
<h2>Overview<a class="headerlink" href="#overview" title="Link to this heading"></a></h2>
<p>A cumulative histogram is a histogram in which each bin stores the count / frequency of itself
as well as all the bins with keys smaller than the particular bin.
As such, a notion of ordering among its keys should be existent in the histogram.</p>
<p>The GIL histogram class has the ability to convert itself into its cumulative version.</p>
<p>Since the container needs to first get an ordering
over the keys a key sorting takes place before calculating the cumulative histogram.</p>
<p>Example:</p>
<blockquote>
<div><div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="n">histogram</span><span class="o">&lt;</span><span class="kt">int</span><span class="p">,</span><span class="w"> </span><span class="kt">float</span><span class="o">&gt;</span><span class="w"> </span><span class="n">h</span><span class="p">;</span>
<span class="cm">/*</span>
<span class="cm">Fill histogram ...</span>
<span class="cm">*/</span>
<span class="k">auto</span><span class="w"> </span><span class="n">h1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">cumulative_histogram</span><span class="p">(</span><span class="n">h</span><span class="p">);</span>
</pre></div>
</div>
</div></blockquote>
<p>Tip: <em>In case you need to store the cumulative histogram elsewhere, consider creating a copy of the histogram
and then call the function</em>.</p>
</section>
</section>
<div class="navbar" style="text-align:right;">
<a class="prev" title="Making a sub-histogram" href="subhistogram.html"><img src="../_static/prev.png" alt="prev"/></a>
<a class="up" title="Histogram" href="index.html"><img src="../_static/up.png" alt="up"/></a>
<a class="next" title="STL compatibility" href="stl_compatibility.html"><img src="../_static/next.png" alt="next"/></a>
</div>
</div>
<div class="footer" role="contentinfo">
Last updated on 2026-02-06 18:02:17.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 7.2.6.
</div>
</body>
</html>