Initialization¶
This page contains information about initialising the CongruenceInterface
class.
-
inline void libsemigroups::CongruenceInterface::add_pair(std::initializer_list<size_t> l, std::initializer_list<size_t> r)¶
Add a generating pair to the congruence.
-
void libsemigroups::CongruenceInterface::add_pair(word_type const &u, word_type const &v)¶
Add a generating pair to the congruence.
- Complexity
Linear in
u.size() + v.size()
.
Note
In some circumstances this function does not do anything. These are:
if
u
andv
are identical wordsif
has_parent_froidure_pin()
returnstrue
and the wordsu
andv
represent the same element ofparent_froidure_pin()
.
- Parameters
u – a word (vector of integers) over the generators of the semigroup.
v – a word (vector of integers) over the generators of the semigroup.
- Throws
LibsemigroupsException – if the number of generators has not yet been set via set_number_of_generators()
LibsemigroupsException – if
u
orv
contains a letter that is out of bounds.LibsemigroupsException – if started() returns
true
indicating that the underlying algorithm has been applied (partially or fully) to the data structure.
- Returns
(None)
-
inline size_t libsemigroups::CongruenceInterface::number_of_generating_pairs() const noexcept¶
The number of generating pairs.
This function returns the number of generating pairs of the congruence.
See also
- Complexity
Constant.
- Parameters
(None)
- Throws
(None) – This function is
noexcept
and is guaranteed never to throw.- Returns
A value of type
size_t
.
-
inline size_t libsemigroups::CongruenceInterface::number_of_generators() const noexcept¶
The number of generators.
This function returns the number of generators of the semigroup of the congruence that an object of this type represents, or UNDEFINED if this has not been defined.
See also
- Complexity
Constant.
- Parameters
(None)
- Throws
(None) – This function is
noexcept
and is guaranteed never to throw.- Returns
A value of type
size_t
.
-
void libsemigroups::CongruenceInterface::set_number_of_generators(size_t n)¶
Set the number of generators of the congruence.
- Complexity
Constant.
- Parameters
n – the number of generators.
- Throws
LibsemigroupsException – If the number of generators has already been set to another value, or the parameter
n
is 0.- Returns
(None)