| 73 | } |
| 74 | |
| 75 | void 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 | |
| 93 | int main(int argc, char** argv) { |
| 94 | constexpr unsigned nfill = 6000000; |
no test coverage detected