/* Copyright (C) 2018 David Robillard This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "bench_utils.hpp" #include "test_utils.hpp" #include "chilbert/BoundedBitVec.hpp" // IWYU pragma: keep #include "chilbert/DynamicBitVec.hpp" // IWYU pragma: keep #include "chilbert/SmallBitVec.hpp" #include "chilbert/StaticBitVec.hpp" // IWYU pragma: keep #include "chilbert/chilbert.hpp" #include #include #include #include template struct BenchCoordsToIndex { Duration operator()(Context& ctx) { const auto p = make_random_point(ctx); H ha = make_zero_bitvec(); return run_bench([&](auto) { chilbert::coords_to_index(p, M, D, ha); }); } }; template struct BenchIndexToCoords { Duration operator()(Context& ctx) { auto p = make_random_point(ctx); const H ha = make_random_bitvec(ctx); return run_bench([&](auto) { chilbert::index_to_coords(p, M, D, ha); }); } }; /// Run benchmark for size N template