Generation of permutations.
More...
Generation of permutations.
Its instances have the properties:
Examples
std::cout <<
.
gen_until([](
const auto &perm) {
return perm.parity() == -1; }, 100)
.inverse()
<< std::endl;
auto gen_until(Pred predicate, int max_tries, Args &&...args) const
Generates a random instance from the valid set until a condition is met.
instance & add_1()
Adds 1 for printing.
permutation & cycles(const std::vector< int > &cycle_sizes)
Restricts generator s.t. cycle sizes are fixed.
instance gen() const
Generates a random instance from the set of valid permutations.
permutation & fix(int idx, int value)
Restricts generator s.t. value at index is fixed.