Word to class index
This page contains documentation for the member functions of ToddCoxeter
that can be used to convert a word into the index of congruence class.
- ToddCoxeter.current_index_of(self: ToddCoxeter, w: list[int] | str) int | Undefined
Returns the current index of the class containing a word.
This function returns the current index of the class containing the word w No enumeration is triggered by calls to this function. Unless
Runner.finished
returnsTrue
, the index returned by this function is essentially arbitrary, and can only really be used to check whether or not two words are currently known to belong to the congruence. The returned index is obtained by following the path incurrent_word_graph
from node0
labelled by the word w. If there is no such path, thenUNDEFINED
is returned.- Parameters:
- Returns:
The current index of the class containing the word.
- Return type:
- Raises:
LibsemigroupsError – if any of the values in w is out of range, i.e. they do not belong to
presentation().alphabet()
andPresentation.throw_if_letter_not_in_alphabet
raises.
- ToddCoxeter.index_of(self: ToddCoxeter, w: list[int] | str) int
Returns the index of the class containing a word.
This function returns the index of the class containing the word w A full enumeration is triggered by calls to this function. If the
current_word_graph
has not already been standardized, then this function first standardizes it with respect toOrder.shortlex
; otherwise the existing standardization order is used. The returned index is obtained by following the path incurrent_word_graph
from node0
labelled by the word w Since a full enumeration is triggered by calls to this function, the word graph is complete, and so the return value is neverUNDEFINED
.- Parameters:
- Returns:
The index of the class containing the word.
- Return type:
- Raises:
LibsemigroupsError – if any of the values in w, i.e. they do not belong to
presentation().alphabet()
andPresentation.throw_if_letter_not_in_alphabet
raises.