minimal_factorisation(word_type&, element_index_type)

void libsemigroups::FroidurePinBase::minimal_factorisation(word_type &word, element_index_type pos)

Changes word in-place to contain a minimal word with respect to the short-lex ordering in the generators equal to the pos element of the semigroup.

If pos is less than the size of this semigroup, then this member function changes its first parameter word in-place by first clearing it and then to contain a minimal factorization of the element in position pos of the semigroup with respect to the generators of the semigroup. This member function enumerates the semigroup until at least the pos element is known. If pos is greater than the size of the semigroup, then a LibsemigroupsException is thrown.