[Boost-bugs] [Boost C++ Libraries] #3038: [accumulators] Empty histogram

Subject: [Boost-bugs] [Boost C++ Libraries] #3038: [accumulators] Empty histogram
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-05-15 18:37:37


#3038: [accumulators] Empty histogram
------------------------------------------------------+---------------------
 Reporter: Robert Kubrick <robertkubrick_at_[hidden]> | Owner: eric_niebler
     Type: Bugs | Status: new
Milestone: Boost 1.40.0 | Component: None
  Version: Boost 1.38.0 | Severity: Problem
 Keywords: histogram density |
------------------------------------------------------+---------------------
 When the number of samples entered is lower than the cache_size parameter,
 histogram is not initialized. Example:


 {{{
   typedef iterator_range<std::vector<std::pair<double, double> >::iterator
> histogram_type;
     accumulator_set<double, features<tag::density> >
 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 < hist.size(); i++ )
       std::cout << "Bin lower bound: " << hist[i].first << ", Value: " <<
 hist[i].second << std::endl;

     return 0;
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3038>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:00 UTC