1
0

Add complex solver benchmarks

This commit is contained in:
David Allemang
2021-11-12 20:45:42 -05:00
parent bdecf40345
commit cd8ef050e6

View File

@@ -1,17 +1,40 @@
#include <ctime>
#include <iostream>
#include <iomanip>
#include <tc/complex.hpp>
#include <tc/groups.hpp>
template<unsigned int N, class G>
void test(const G &group) {
auto s = std::clock();
auto combos = tc::combinations(group.gens, N - 1);
auto data = tc::merge<N>(tc::hull<N>(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<tc::Symbol> combos = tc::combinations(group.gens, N - 1);
auto data = tc::merge<N>(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;
}