letter_to_pos

element_index_type libsemigroups::FroidurePin::letter_to_pos(letter_type i) const

Returns the position in this of the generator with index i.

If i is not a valid generator index, a LibsemigroupsException will be thrown. In many cases letter_to_pos(i) will equal i, examples of when this will not be the case are:

  • there are duplicate generators;

  • FroidurePin::add_generators was called after the semigroup was already partially enumerated.