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

Function main

examples/guide_custom_axis.cpp:20–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18};
19
20int main() {
21 auto h = bh::make_static_histogram(custom_axis(0, 3));
22 h("-10");
23 h("0");
24 h("1");
25 h("9");
26
27 for (auto xi : h.axis()) {
28 std::cout << "bin " << xi.idx() << " [" << xi.lower() << ", "
29 << xi.upper() << ") " << h.at(xi).value() << std::endl;
30 }
31
32 /* prints:
33 bin 0 [0, 1) 1
34 bin 1 [1, 2] 1
35 bin 2 [2, 3] 0
36 */
37}
38
39//]

Callers

nothing calls this directly

Calls 8

make_static_histogramFunction · 0.85
axisMethod · 0.80
upperMethod · 0.80
atMethod · 0.80
custom_axisClass · 0.70
idxMethod · 0.45
lowerMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected