mirror of
https://github.com/allemangD/toddcox-visualize.git
synced 2025-11-10 12:02:47 -05:00
first attempt at a general triangulation algorithm
This commit is contained in:
@@ -66,6 +66,35 @@ namespace tc {
|
||||
return g;
|
||||
}
|
||||
|
||||
Group Group::shrink(const std::vector<int> &gens) const {
|
||||
Group g(ngens);
|
||||
for (const auto &i : gens) {
|
||||
for (const auto &j : gens) {
|
||||
g._mults[i][j] = _mults[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
std::stringstream ss;
|
||||
ss << name << "{";
|
||||
for (auto e : gens) ss << " " << e;
|
||||
ss << " }";
|
||||
g.name = ss.str();
|
||||
|
||||
return g;
|
||||
}
|
||||
|
||||
bool Group::trivial() const {
|
||||
for (int i = 0; i < ngens; ++i) {
|
||||
for (int j = 0; j < ngens; ++j) {
|
||||
if (_mults[i][j] != 2) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Group operator*(const Group &g, const Group &h) {
|
||||
return g.product(h);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user