MCPcopy Create free account
hub / github.com/boostorg/histogram / main

Function main

examples/guide_make_dynamic_histogram.cpp:8–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6namespace bh = boost::histogram;
7
8int main() {
9 // create vector of axes, axis::any is a polymorphic axis type
10 auto v = std::vector<bh::axis::any_std>();
11 v.push_back(bh::axis::regular<>(100, -1, 1));
12 v.push_back(bh::axis::integer<>(1, 7));
13
14 // create dynamic histogram (make_static_histogram cannot be used with iterators)
15 auto h = bh::make_dynamic_histogram(v.begin(), v.end());
16
17 // do something with h
18
19
20
21 // make_dynamic_histogram copies axis objects; to instead move the whole axis
22 // vector into the histogram, create a histogram instance directly
23 auto h2 = bh::histogram<decltype(v)>(std::move(v));
24
25 // do something with h2
26}
27
28//]

Callers

nothing calls this directly

Calls 3

make_dynamic_histogramFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected