mirror of
https://github.com/boostorg/histogram.git
synced 2025-05-12 05:31:51 +00:00
15 lines
340 B
C++
15 lines
340 B
C++
#include <boost/histogram.hpp>
|
|
#include <algorithm>
|
|
#include <vector>
|
|
|
|
namespace bh = boost::histogram;
|
|
|
|
int main() {
|
|
auto h = bh::make_static_histogram(bh::axis::integer<>(0, 9));
|
|
std::vector<int> v{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
|
std::for_each(v.begin(), v.end(),
|
|
[&h](int x) { h.fill(x, bh::weight(2.0)); }
|
|
);
|
|
// h is now filled
|
|
}
|