Replace ComboIterator with std::set<std::vector<int>> via combinations.hpp

Since the number of generators never exceeds 6, the maximum number of combinations is (6, 3) = 20, so the space optimizations of using an iterator is mute.

Doing this way also allows to use set_difference and set_union to deal with collections of subgroups. This is not easily possible otherwise.
This commit is contained in:
David Allemang
2020-10-24 23:06:52 -04:00
parent 6e3ea1900b
commit 01043e9bce
5 changed files with 55 additions and 108 deletions

View File

@@ -9,7 +9,7 @@
#include <geometry.hpp>
#include <utility>
#include "combo_iterator.hpp"
#include <combinations.hpp>
/**
* Produce a list of all generators for the group context. The range [0..group.ngens).
@@ -184,7 +184,8 @@ Mesh<N> Mesh<N>::fill(const tc::Group &g, std::vector<int> ctx) {
if (ctx.size() + 1 != N)
throw std::logic_error("ctx size must be one less than N");
const auto &combos = Combos(ctx, (int)ctx.size() - 1);
// const auto &combos = Combos(ctx, (int)ctx.size() - 1);
const auto &combos = combinations(ctx, (int) ctx.size() - 1);
std::vector<Mesh<N>> meshes;