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

Function compare_2d

test/speed_root.cpp:46–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void compare_2d(unsigned n, int distrib) {
47 auto r = random_array(n, distrib);
48
49 double best_root = std::numeric_limits<double>::max();
50 for (unsigned k = 0; k < 20; ++k) {
51 TH2I hroot("", "", 100, 0, 1, 100, 0, 1);
52 auto t = clock();
53 for (unsigned i = 0; i < n / 2; ++i) hroot.Fill(r[2 * i], r[2 * i + 1]);
54 t = clock() - t;
55 best_root = std::min(best_root, double(t) / CLOCKS_PER_SEC);
56 }
57 printf("root %.3f\n", best_root);
58}
59
60void compare_3d(unsigned n, int distrib) {
61 auto r = random_array(n, distrib);

Callers 1

mainFunction · 0.70

Calls 1

random_arrayFunction · 0.70

Tested by

no test coverage detected