add descriptions and stubs for functions we'll need. don't bother with memoizing for now.

This commit is contained in:
2020-01-17 11:05:19 -05:00
parent b4faff1782
commit f27473f501

View File

@@ -4,35 +4,24 @@
#include <optional>
#include <cmath>
size_t key(const std::vector<int> &gens) {
size_t bits = 0;
for (const auto &gen : gens) {
bits |= 1U << gen;
}
return bits;
}
/**
* Given elements of a subgroup, find the parent group's names for those same elements.
*
* Raise.
*/
void recontext() {}
struct CosetMemo {
const tc::Group &parent;
std::vector<std::vector<std::optional<tc::Cosets>>> results;
/**
* Given some elements of a group and some subgroup, tile those elements according to the cosets of that subgroup
*/
void tile() {}
explicit CosetMemo(const tc::Group &parent)
: parent(parent) {
size_t W = std::pow(2, parent.ngens);
/**
* Given some elements of a group, apply a transformation to all elements.
*/
void translate() {}
for (size_t i = 0; i < W; ++i) {
results.emplace_back(W, std::nullopt);
}
}
tc::Cosets solve(const std::vector<int> &group_gens, const std::vector<int> &sub_gens) {
size_t group_key = key(group_gens);
size_t sub_key = key(sub_gens);
if (!results[group_key][sub_key]) {
results[group_key][sub_key] = parent.subgroup(group_gens).solve(sub_gens);
}
return results[group_key][sub_key].value();
}
};
/**
* Given some group representing an n-dimensional polyhedron, produce (n-1)-simplices that fill the surface of the polyhedron.
*/
void triangulate() {}