forked from mirror/toddcox-faster
Un-template groups.
Templating the groups doesn't improve performance that much, but it severely hinders usability. Switch things to be dynamically sized so that different ranked groups are the same type. Could also now separate headers and implementation... but will probably leave it for now.
This commit is contained in:
@@ -22,17 +22,17 @@ void test(const G &group) {
|
||||
}
|
||||
|
||||
int main() {
|
||||
test(tc::group::H<2>());
|
||||
test(tc::group::H<3>());
|
||||
test(tc::group::H<4>());
|
||||
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>());
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -4,20 +4,21 @@
|
||||
#include <tc/groups.hpp>
|
||||
|
||||
int main() {
|
||||
constexpr unsigned int Rank = 5;
|
||||
constexpr unsigned int SRank = 3;
|
||||
tc::Symbol symbol(4);
|
||||
symbol << 5, 3, 2, 3;
|
||||
tc::Group group = tc::schlafli(symbol);
|
||||
// tc::Group group = tc::group::E(7);
|
||||
|
||||
tc::Group<Rank> group = tc::schlafli<Rank>({5, 3, 2, 3});
|
||||
// tc::Group<Rank> group = tc::group::E<Rank>();
|
||||
size_t srank = 3;
|
||||
|
||||
tc::SubGroups<Rank, SRank> subs = tc::subgroups<Rank, SRank>(group);
|
||||
tc::SubGroups subs = tc::subgroups(group, srank);
|
||||
|
||||
std::cout << "Group " << group.name << " (" << subs.size() << " subgroups)" << std::endl;
|
||||
std::cout << group << std::endl;
|
||||
|
||||
for (const auto &sub: subs) {
|
||||
for (int i = 0; i < SRank; ++i) {
|
||||
for (int j = 0; j < SRank; ++j) {
|
||||
for (int i = 0; i < srank; ++i) {
|
||||
for (int j = 0; j < srank; ++j) {
|
||||
auto sub_mult = sub(i, j);
|
||||
auto src_mult = group(sub.gens(i), sub.gens(j));
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <tc/groups.hpp>
|
||||
|
||||
int main() {
|
||||
auto cube = tc::group::B<3>();
|
||||
auto cube = tc::group::B(3);
|
||||
auto vars = tc::solve(cube);
|
||||
|
||||
std::string start;
|
||||
|
||||
Reference in New Issue
Block a user