46 const std::vector<double>& values,
49 for (
const auto v : values) {
55 const std::vector<std::pair<double,double>>& weighted_values
57 for(
auto const& pair : weighted_values ) {
65 swap(values_, other.values_);
74 return values_.cbegin();
79 return values_.cend();
109 return values_.begin()->first;
114 return values_.rbegin()->first;
119 return values_.size();
124 return values_.empty();
135 return added_values_;
152 auto upper = std::nextafter(
max(),
max() + 1);
154 if (integer_ranges) {
155 lower = std::floor(lower);
156 upper = std::ceil(upper);
159 auto h =
Histogram(num_bins, lower, upper);
160 for (
const auto& pair : values_) {
161 h.accumulate(pair.first, pair.second);
173 for (
const auto& pair : values_) {
174 h.accumulate(pair.first, pair.second);
Header of Histogram class.
void swap(SequenceSet &lhs, SequenceSet &rhs)
void swap(HistogramAccumulator &other)
Histogram class for accumulating and summarizing data.
Histogram build_uniform_ranges_histogram(size_t num_bins, bool integer_ranges=false) const
Container namespace for all symbols of genesis in order to keep them separate when used as a library...
Histogram helper class that collects data and builds a fitting Histogram.
void accumulate(double x, double weight)
Header of Histogram Accumulator class.
const_iterator begin() const
const_iterator end() const
std::map< double, double >::const_iterator const_iterator
size_t added_values() const
Return the number of values that have been added to the Accumulator.