Prefixes and suffixes

This page contains information about the member functions of the FroidurePinBase class related to prefixes and suffixes.

inline letter_type libsemigroups::FroidurePinBase::final_letter(element_index_type pos) const

Returns the last letter of the element with specified index.

This function returns the final letter of the element in position pos of the semigroup, which is the index of the generator corresponding to the final letter of the element.

Complexity

Constant.

Note

Note that FroidurePin::generator(first_letter(pos)) is only equal to FroidurePin::at(first_letter(pos)) if there are no duplicate generators.

Parameters

pos – the position

Throws

LibsemigroupsException – if pos is greater than or equal to current_size.

Returns

A value of type letter_type.

inline letter_type libsemigroups::FroidurePinBase::first_letter(element_index_type pos) const

Returns the first letter of the element with specified index.

This function returns the first letter of the element in position pos of the semigroup, which is the index of the generator corresponding to the first letter of the element.

Complexity

Constant.

Note

Note that FroidurePin::generator(first_letter(pos)) is only equal to FroidurePin::at(first_letter(pos)) if there are no duplicate generators.

Parameters

pos – the position

Throws

LibsemigroupsException – if pos is greater than or equal to current_size.

Returns

A value of type letter_type.

inline element_index_type libsemigroups::FroidurePinBase::prefix(element_index_type pos) const

Returns the position of the longest proper prefix.

Returns the position of the prefix of the element x in position pos (of the semigroup) of length one less than the length of x.

Complexity

Constant.

Parameters

pos – the position

Throws

LibsemigroupsException – if pos is greater than or equal to current_size.

Returns

A value of type element_index_type.

inline element_index_type libsemigroups::FroidurePinBase::suffix(element_index_type pos) const

Returns the position of the longest proper suffix.

Returns the position of the suffix of the element x in position pos (of the semigroup) of length one less than the length of x.

Complexity

Constant.

Parameters

pos – the position

Throws

LibsemigroupsException – if pos is greater than or equal to current_size.

Returns

A value of type element_index_type.