closure(TCollection const&)ΒΆ

template<typename TCollection>
void libsemigroups::FroidurePin::closure(TCollection const &coll)

Add copies of the non-redundant generators in coll to the generators of this.

This member function can be used to add new generators to an 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 in coll.

This member function differs from FroidurePin::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 in 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, or number of idempotents, for example.

The elements the parameter coll are copied into the semigroup, and should be deleted by the caller. If an element in coll has a degree different to this->degree(), a LibsemigroupsException will be thrown.