Words to strings and vice versa

This page contains information about the functions in the FpSemigroupInterface class for converting from words to strings and vice versa.

inline letter_type libsemigroups::FpSemigroupInterface::char_to_uint(char a) const

Convert a char to a letter_type.

Complexity.

Constant.

Parameters

a – the string to convert.

Throws

LibsemigroupsException – if a is not in alphabet().

Returns

a letter_type.

word_type libsemigroups::FpSemigroupInterface::string_to_word(std::string const &w) const

Convert a string to a word_type.

Complexity

\(O(n)\) where \(n\) is the length of w.

Parameters

w – the string to convert.

Throws

LibsemigroupsException – if w contains any characters not in alphabet().

Returns

a word_type.

inline char libsemigroups::FpSemigroupInterface::uint_to_char(letter_type a) const

Convert a letter_type to a char.

Complexity.

Constant.

Parameters

a – the letter_type to convert.

Throws

LibsemigroupsException – if a is out of range.

Returns

A char.

std::string libsemigroups::FpSemigroupInterface::word_to_string(word_type const &w) const

Convert a word_type to a std::string.

Complexity.

\(O(n)\) where \(n\) is the length of w.

Parameters

w – the word_type to convert.

Throws

LibsemigroupsException – if w contains any indices that are out of range.

Returns

a std::string