![]() |
Mackey
V3.3
A C++ library for computing RO(G) graded homology
|
Generates all combinations on a number of letters making a number of choices. More...
#include <Generators.hpp>
Classes | |
class | ConstIterator |
Constant iterator that is used in a ranged for loop to generate the combinations. More... | |
Public Member Functions | |
auto | size () const |
Computes total number of combinations. More... | |
CombinationGenerator (T total, T choices) | |
Sets up the generator. More... | |
ConstIterator | begin () const |
Begin iterator. More... | |
ConstIterator | end () const |
End iterator. More... | |
Generates all combinations on a number of letters making a number of choices.
Use with a ranged for loop: If v
is a CombinationGenerator
object then in
the variable i
will range over all combinations.
T | The data type of our combinations eg int |
CombinationGenerator | ( | T | total, |
T | choices | ||
) |
Sets up the generator.
total | The number of letters |
choices | The number of choices |
auto size | ( | ) | const |
Computes total number of combinations.
ConstIterator begin | ( | ) | const |
Begin iterator.
ConstIterator end | ( | ) | const |
End iterator.