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

Function compare_6d

test/speed_root.cpp:75–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75void compare_6d(unsigned n, int distrib) {
76 auto r = random_array(n, distrib);
77
78 double best_root = std::numeric_limits<double>::max();
79 for (unsigned k = 0; k < 20; ++k) {
80 std::vector<int> bin(6, 10);
81 std::vector<double> min(6, 0);
82 std::vector<double> max(6, 1);
83 THnI hroot("", "", 6, &bin.front(), &min.front(), &max.front());
84
85 auto t = clock();
86 for (unsigned i = 0; i < n / 6; ++i) { hroot.Fill(r.get() + 6 * i); }
87 t = clock() - t;
88 best_root = std::min(best_root, double(t) / CLOCKS_PER_SEC);
89 }
90 printf("root %.3f\n", best_root);
91}
92
93int main(int argc, char** argv) {
94 constexpr unsigned nfill = 6000000;

Callers 1

mainFunction · 0.70

Calls 2

getMethod · 0.80
random_arrayFunction · 0.70

Tested by

no test coverage detected