add_generator¶
-
void
libsemigroups::FroidurePin
::
add_generator
(element_type const&)¶ Add copies of the generators
coll
to the generators ofthis
.This member function can be used to add new generators to the existing semigroup 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 in the parameter
coll
.This member function changes the semigroup in-place, 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 semigroup 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 member function is called the semigroup might contain many more elements than before (whether it is fully enumerating or not). It can also be the case that the new generators are the only new elements, unlike, say, in the case of non-trivial groups.
The elements of the argument
coll
are copied into the semigroup, and should be deleted by the caller. If an element incoll
has a degree different tothis->degree()
, a LibsemigroupsException will be thrown.