1
0

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:
David Allemang
2021-11-07 20:40:34 -05:00
parent 24e7ab47d1
commit fa13493569
10 changed files with 222 additions and 237 deletions

View File

@@ -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));