mirror of
https://github.com/boostorg/histogram.git
synced 2025-05-09 23:04:07 +00:00
21 lines
513 B
C++
21 lines
513 B
C++
//[ guide_make_dynamic_histogram
|
|
|
|
#include <boost/histogram.hpp>
|
|
#include <vector>
|
|
|
|
namespace bh = boost::histogram;
|
|
|
|
int main() {
|
|
// create vector of axes, axis::any is a polymorphic axis type
|
|
auto v = std::vector<bh::axis::any<>>();
|
|
v.push_back(bh::axis::regular<>(100, -1, 1));
|
|
v.push_back(bh::axis::integer<>(1, 7));
|
|
|
|
// create dynamic histogram (make_static_histogram be used with iterators)
|
|
auto h = bh::make_dynamic_histogram(v.begin(), v.end());
|
|
|
|
// do something with h
|
|
}
|
|
|
|
//]
|