word_to_pos

element_index_type libsemigroups::FroidurePinBase::word_to_pos(word_type const &w) const

Returns the position in the semigroup corresponding to the element represented by the word w.

The parameter w must consist of non-negative integers less than FroidurePin::nr_generators, or a LibsemigroupsException will be thrown. This member function returns the position in this of the element obtained by evaluating w. This member function does not perform any enumeration of the semigroup, and will return libsemigroups::UNDEFINED if the position of the element of this corresponding to w cannot be determined.

This is equivalent to finding the product x of the generators FroidurePin::generator(w[i]) and then calling FroidurePin::position_current with argument x.

See

FroidurePin::word_to_element.