Initialisation¶
This page contains information about the member functions of the FroidurePin
class that can be used for initialisation.

void libsemigroups::FroidurePin::add_generator(const_reference x)¶
Add a copy of an element to the generators.
This function can be used to add new generators to an existing FroidurePin instance in such a way that any previously enumerated data is preserved and not recomputed, or copied. This can be faster than recomputing the semigroup generated by the old generators and the new generators.
This function changes the semigroup inplace, thereby invalidating possibly previously known data about the semigroup, such as the left or right Cayley graphs, number of idempotents, and so on.
Every generator in
coll
is added regardless of whether or not it is already a generator or element of the semigroup (it may belong to the semigroup but just not be known to belong). Ifcoll
is empty, then the semigroup is left unchanged. The order the generators is added is also the order they occur in the parametercoll
.The FroidurePin instance is returned in a state where all of the previously enumerated elements which had been multiplied by all of the old generators, have now been multiplied by all of the old and new generators. This means that after this function is called the semigroup might contain many more elements than before (whether it is fully enumerating or not).
 Parameters
x – the generator to add.
 Throws
LibsemigroupsException – if any of the following hold:
immutable() returns
true
the degree of
x
is incompatible with the existing degree.
 Returns
(None)

template<typename T>
void libsemigroups::FroidurePin::add_generators(T const &coll)¶ Add collection of generators via const reference.
See add_generator for a detailed description.
 Template Parameters
T – the type of the container for generators to add (must be a nonpointer type).
 Parameters
coll – the collection of generators to add.
 Throws
LibsemigroupsException – if any of the following hold:
immutable() returns
true
the degree of
x
is incompatible with the existing degree.
 Returns
(None)

template<typename T>
void libsemigroups::FroidurePin::add_generators(T const &first, T const &last)¶ Add collection of generators via iterators.
See add_generator for a detailed description.
 Template Parameters
the – type of an iterator pointing to an element_type.
 Parameters
first – iterator pointing to the first generator to add.
last – iterator pointing one past the last generator to add.
 Throws
LibsemigroupsException – if any of the following hold:
immutable() returns
true
the degree of
x
is incompatible with the existing degree.
 Returns
(None)

void libsemigroups::FroidurePin::add_generators(std::initializer_list<const_element_type> coll)¶
Add collection of generators via initializer list.
See add_generator for a detailed description.
 Parameters
coll – the collection of generators to add.
 Throws
LibsemigroupsException – if any of the following hold:
immutable() returns
true
the degree of
x
is incompatible with the existing degree.
 Returns
(None)

template<typename T>
void libsemigroups::FroidurePin::closure(T const &coll)¶ Add nonredundant generators in collection.
Add copies of the nonredundant generators in
coll
to the generators ofthis
.This function differs from add_generators in that it tries to add the new generators one by one, and only adds those generators that are not products of existing generators (including any new generators from
coll
that were added before). The generators are added in the order they occur incoll
.This function changes
this
inplace, thereby invalidating some previously computed information, such as the left or right Cayley graphs, or number of idempotents, for example. Template Parameters
T – the type of the container for generators to add (must be a nonpointer type).
 Parameters
coll – the collection of generator to add.
 Throws
LibsemigroupsException – if add_generator throws.
 Returns
(None)

void libsemigroups::FroidurePin::closure(std::initializer_list<const_element_type> coll)¶
Add nonredundant generators in collection.
Add copies of the nonredundant generators in
coll
to the generators ofthis
.This function differs from add_generators in that it tries to add the new generators one by one, and only adds those generators that are not products of existing generators (including any new generators from
coll
that were added before). The generators are added in the order they occur incoll
.This function changes
this
inplace, thereby invalidating some previously computed information, such as the left or right Cayley graphs, or number of idempotents, for example. Template Parameters
T – the type of the container for generators to add (must be a nonpointer type).
 Parameters
coll – the collection of generator to add.
 Throws
LibsemigroupsException – if add_generator throws.
 Returns
(None)

template<typename T>
FroidurePin libsemigroups::FroidurePin::copy_add_generators(T const &coll) const¶ Copy and add a collection of generators.
This function is equivalent to copy constructing an new FroidurePin instance and then calling add_generators on the copy. But this function avoids copying the parts of
this
that are immediately invalidated by add_generators. Template Parameters
T – the type of the container for generators to add (must be a nonpointer type).
 Parameters
coll – the collection of generators to add.
 Throws
LibsemigroupsException – if the copy constructor or add_generators throws.
 Returns
A new FroidurePin instance by value generated by the generators of
this
andcoll
.

FroidurePin libsemigroups::FroidurePin::copy_add_generators(std::initializer_list<element_type> coll)¶
Copy and add a collection of generators.
This function is equivalent to copy constructing an new FroidurePin instance and then calling add_generators on the copy. But this function avoids copying the parts of
this
that are immediately invalidated by add_generators. Template Parameters
T – the type of the container for generators to add (must be a nonpointer type).
 Parameters
coll – the collection of generators to add.
 Throws
LibsemigroupsException – if the copy constructor or add_generators throws.
 Returns
A new FroidurePin instance by value generated by the generators of
this
andcoll
.

template<typename T>
FroidurePin libsemigroups::FroidurePin::copy_closure(T const &coll)¶ Copy and add nonredundant generators.
This function is equivalent to copy constructing an new FroidurePin instance and then calling closure on the copy. But this function avoids copying the parts of
this
that are immediately invalidated by closure. Template Parameters
T – the type of the container for generators to add (must be a nonpointer type).
 Parameters
coll – the collection of generators to add.
 Throws
LibsemigroupsException – if the copy constructor or add_generators throws.
 Returns
A new FroidurePin instance by value generated by the generators of
this
andcoll
.

FroidurePin libsemigroups::FroidurePin::copy_closure(std::initializer_list<element_type> coll)¶
Copy and add nonredundant generators.
This function is equivalent to copy constructing an new FroidurePin instance and then calling closure on the copy. But this function avoids copying the parts of
this
that are immediately invalidated by closure. Template Parameters
T – the type of the container for generators to add (must be a nonpointer type).
 Parameters
coll – the collection of generators to add.
 Throws
LibsemigroupsException – if the copy constructor or add_generators throws.
 Returns
A new FroidurePin instance by value generated by the generators of
this
andcoll
.

inline std::shared_ptr<state_type> libsemigroups::FroidurePin::state() const¶
Returns a std::shared_ptr to the state (if any).
 Parameters
(None)
 Throws
(None) – This function guarantees not to throw a
LibsemigroupsException
. Returns