1
0
Files
toddcox-faster/example/bench.cpp
David Allemang 24d4d1873a Make tc::Group an Eigen::Matrix (Schafli Matrix)
Makes tc::Group a direct subclass of Eigen::Matrix. Group should represent a Schlafli matrix.

Added a note that tc::solve assumes the matrix to be for a coxeter group.

In theory we could also implement the "normal" todd-coxeter and allow any Schlafli matrix as input.
2021-11-01 16:58:48 -04:00

39 lines
871 B
C++

#include "tc/core.hpp"
#include "tc/groups.hpp"
#include <ctime>
#include <iostream>
#include <iomanip>
template<class G>
void test(const G &group) {
auto s = std::clock();
auto cosets = tc::solve(group, {0});
auto e = std::clock();
double diff = (double) (e - s) / CLOCKS_PER_SEC;
int order = cosets.order();
std::cout
<< std::setw(7) << group.name << ", "
<< std::setw(7) << order << ", "
<< std::fixed << std::setprecision(6) << diff << "s"
<< std::endl;
}
int main() {
test(tc::group::H<2>());
test(tc::group::H<3>());
test(tc::group::H<4>());
test(tc::group::T(100));
test(tc::group::T(500));
test(tc::group::T(1000));
test(tc::group::E<6>());
test(tc::group::E<7>());
test(tc::group::B<6>());
test(tc::group::B<7>());
test(tc::group::B<8>());
return 0;
}