cbegin_rules¶
-
const_rule_iterator
libsemigroups::FroidurePinBase
::
cbegin_rules
() const¶ Returns a forward iterator pointing to the first rule in a confluent terminating rewriting system defining a semigroup isomorphic to the one defined by
this
.This function does not perform any enumeration of the FroidurePin. If you want to obtain the complete set of rules, then it is necessary to FroidurePin::run until the FroidurePin is fully enumerated.
- Return
An iterator of type const_rule_iterator pointing to a libsemigroups::relation_type.
- Parameters
(None).
- Exceptions
This function guarantees not to throw a LibsemigroupsException.
- Complexity
Constant
- Iterator validity
The iterators returned by this are valid until
this
is deleted.- See
- Example
FroidurePin<BMat8> S; S.add_generator(BMat8({{1, 0, 0, 0}, {1, 0, 0, 0}, {1, 0, 0, 0}, {1, 0, 0, 0}})); S.add_generator(BMat8({{0, 1, 0, 0}, {0, 1, 0, 0}, {0, 1, 0, 0}, {0, 1, 0, 0}})); S.add_generator(BMat8({{0, 0, 1, 0}, {0, 0, 1, 0}, {0, 0, 1, 0}, {0, 0, 1, 0}})); S.add_generator(BMat8({{0, 0, 0, 1}, {0, 0, 0, 1}, {0, 0, 0, 1}, {0, 0, 0, 1}})); S.size(); // 4 std::vector<relation_type>(S.cbegin_rules(), S.cend_rules()); // {{{0, 0}, {0}}, // {{0, 1}, {1}}, // {{0, 2}, {2}}, // {{0, 3}, {3}}, // {{1, 0}, {0}}, // {{1, 1}, {1}}, // {{1, 2}, {2}}, // {{1, 3}, {3}}, // {{2, 0}, {0}}, // {{2, 1}, {1}}, // {{2, 2}, {2}}, // {{2, 3}, {3}}, // {{3, 0}, {0}}, // {{3, 1}, {1}}, // {{3, 2}, {2}}, // {{3, 3}, {3}}}