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 inthis
of the element obtained by evaluatingw
. This member function does not perform any enumeration of the semigroup, and will return libsemigroups::UNDEFINED if the position of the element ofthis
corresponding tow
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 argumentx
.