23 template <
class spec_t,
class gen_t>
87 const T total, choices;
133 #include "impl/Generators.ipp"
Constant iterator that is used in a ranged for loop to generate the combinations.
Definition: Generators.hpp:102
Generates all combinations on a number of letters making a number of choices.
Definition: Generators.hpp:86
CombinationGenerator(T total, T choices)
Sets up the generator.
auto size() const
Computes total number of combinations.
Prototype for coroutine-like iterators that generate elements such as combinations.
Definition: Generators.hpp:25
bool operator!=(const FactoryGenerator &other) const
Inequality of iterators (used to detect if generation has been completed)
spec_t & operator++()
Generates next element.
static spec_t end()
Terminal iterator.
bool completed
1 if the iterator is end() i.e. if all elements have been generated
Definition: Generators.hpp:32
const gen_t & operator*() const
Returns the generated element.
gen_t generated
The currently generated element.
Definition: Generators.hpp:33
Constant iterator that is used in a ranged for loop to generate the permutations.
Definition: Generators.hpp:61
Generates all permutations on a number of letters.
Definition: Generators.hpp:46
size_t size() const
Computes total number of permutations.
PermutationGenerator(T n)
Constructor sets up the generator.
ConstIterator begin() const
Begin iterator.
Everything in this library is under this namespace.
Definition: Box.hpp:9
std::vector< std::vector< T > > all_permutations(T n)
Returns vector of all permutations on n letters.
std::vector< std::vector< T > > all_combinations(T n, T m)
Returns vector of all combinations on n letters choosing m many.
typename Homology< rank_t, diff_t >::gen_t gen_t
Type of generators in homology.
Definition: Aliases.hpp:72