Boost C++ Libraries: Ticket #3039: [accumulators] Empty histogram https://svn.boost.org/trac10/ticket/3039 <p> When the number of samples entered is lower than the cache_size parameter, histogram is not initialized. Example: </p> <p> </p> <pre class="wiki"> typedef iterator_range&lt;std::vector&lt;std::pair&lt;double, double&gt; &gt;::iterator &gt; histogram_type; accumulator_set&lt;double, features&lt;tag::density&gt; &gt; acc(tag::density::num_bins = 20, tag::density::cache_size = 10); // push in some data ... acc(0.1); acc(1.2); acc(2.3); acc(3.4); acc(4.5); acc(5.4); acc(5.5); // Display the results ... histogram_type hist = density(acc); for( int i = 0; i &lt; hist.size(); i++ ) std::cout &lt;&lt; "Bin lower bound: " &lt;&lt; hist[i].first &lt;&lt; ", Value: " &lt;&lt; hist[i].second &lt;&lt; std::endl; return 0; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3039 Trac 1.4.3 anonymous Fri, 15 May 2009 21:27:00 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3039#comment:1 https://svn.boost.org/trac10/ticket/3039#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">duplicate</span> </li> </ul> Ticket