From cd8ef050e63695e00b86321bc5d76617d4acb7ab Mon Sep 17 00:00:00 2001 From: David Allemang Date: Fri, 12 Nov 2021 20:45:42 -0500 Subject: [PATCH] Add complex solver benchmarks --- examples/complex.cpp | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/examples/complex.cpp b/examples/complex.cpp index f9fc881..b061a81 100644 --- a/examples/complex.cpp +++ b/examples/complex.cpp @@ -1,17 +1,40 @@ +#include #include +#include + #include #include +template +void test(const G &group) { + auto s = std::clock(); + auto combos = tc::combinations(group.gens, N - 1); + auto data = tc::merge(tc::hull(group, combos, {})); + auto e = std::clock(); + + double diff = (double) (e - s) / CLOCKS_PER_SEC; + int count = data.size(); + + std::cout + << std::setw(2) << N << ", " + << std::setw(7) << group.name << ", " + << std::setw(7) << count << ", " + << std::fixed << std::setprecision(6) << diff << "s" + << std::endl; +} + int main() { - tc::Symbol symbol(3); - symbol << 5, 3, 3; - auto group = tc::schlafli(symbol); + test<4>(tc::group::H(4)); + test<4>(tc::group::B(4)); + test<4>(tc::group::B(5)); + test<4>(tc::group::B(6)); + test<4>(tc::group::E(6)); - constexpr int N = 4; - std::vector combos = tc::combinations(group.gens, N - 1); - auto data = tc::merge(tc::hull<4>(group, combos, {})); - - std::cout << data.size() << std::endl; + test<3>(tc::group::H(3)); + test<3>(tc::group::B(4)); + test<3>(tc::group::B(5)); + test<3>(tc::group::B(6)); + test<3>(tc::group::E(6)); return 0; }