This file contains documentation for creating inverse semigroup and monoid presentations in libsemigroups from other types of objects.
Functions | |
| template<typename Result, typename Word> | |
| auto | to (InversePresentation< Word > const &ip) -> std::enable_if_t< std::is_same_v< InversePresentation< typename Result::word_type >, Result > &&!std::is_same_v< Word, typename Result::word_type >, Result > |
| Make an inverse presentation from a different type of inverse presentation when typename Result::word_type and Word are not the same. | |
| template<typename Result, typename Word> | |
| auto | to (InversePresentation< Word > const &ip) noexcept -> std::enable_if_t< std::is_same_v< InversePresentation< Word >, Result >, Result const & > |
| Make an inverse presentation from a different type of inverse presentation when typename Result::word_type and Word are the same. | |
| template<typename Result, typename Word, typename Func> | |
| auto | to (InversePresentation< Word > const &ip, Func &&f) -> std::enable_if_t< std::is_same_v< InversePresentation< typename Result::word_type >, Result >, Result > |
| Make an inverse presentation from a different type of inverse presentation. | |
| template<template< typename... > typename Thing, typename Word> | |
| auto | to (Presentation< Word > const &p) -> std::enable_if_t< std::is_same_v< InversePresentation< Word >, Thing< Word > >, InversePresentation< Word > > |
| Make an inverse presentation from a presentation. | |
| auto to | ( | InversePresentation< Word > const & | ip | ) | -> std::enable_if_t< std::is_same_v< InversePresentation< typename Result::word_type >, Result > &&!std::is_same_v< Word, typename Result::word_type >, Result > |
Defined in to-presentation.hpp.
Despite the hideous signature, this function should be invoked as follows:
This function returns an inverse presentation equivalent to the input inverse presentation but of a different type (for example, can be used to convert from std::string to word_type).
If the alphabet of of ip is \(\{a_0, a_1, \dots a_{n-1}\}\), then the conversion from InversePresentation<WordInput>::letter_type to InversePresentation<WordOutput>::letter_type is \(a_i \mapsto\) human_readable_letter<WordOutput>(size_t i).
| Result | the return type, also used for SFINAE, should be InversePresentation<T> for some type T. |
| Word | the type of the words in the input inverse presentation. |
| ip | the input inverse presentation. |
| LibsemigroupsException | if p.throw_if_bad_alphabet_or_rules() throws. |
|
noexcept |
Defined in to-presentation.hpp.
Despite the hideous signature, this function should be invoked as follows:
This function just returns its argument ip (as a reference), and is included solely for the purpose of simplifying certain client code, where inverse presentations must be converted from one type to another sometimes, but not other times.
| Result | the return type, also used for SFINAE, should be InversePresentation<T> for some type T. |
| Word | the type of the words in the input inverse presentation. |
| ip | the input inverse presentation. |
This function is noexcept and is guaranteed never to throw.
| auto to | ( | InversePresentation< Word > const & | ip, |
| Func && | f ) -> std::enable_if_t< std::is_same_v< InversePresentation< typename Result::word_type >, Result >, Result > |
Defined in to-presentation.hpp.
Despite the hideous signature, this function should be invoked as follows:
This function returns an inverse presentation equivalent to the input inverse presentation but of a different type (for example, can be used to convert from std::string to word_type). The second parameter specifies how to map the letters of one inverse presentation to the other.
| Result | the return type, also used for SFINAE, should be InversePresentation<T> for some type T. |
| Word | the type of the words in the input inverse presentation. |
| Func | the type of a function for transforming letters. |
| ip | the input inverse presentation. |
| f | a function mapping InversePresentation<Word>::letter_type to Result::letter_type. |
| LibsemigroupsException | if p.throw_if_bad_alphabet_or_rules() throws. |
Func must be a function type that is invocable with values of Presentation<Word>::letter_type. If this is not true, then template substitution will fail.| auto to | ( | Presentation< Word > const & | p | ) | -> std::enable_if_t< std::is_same_v< InversePresentation< Word >, Thing< Word > >, InversePresentation< Word > > |
Defined in to-presentation.hpp.
Despite the hideous signature, this function should be invoked as follows:
This function returns an inverse presentation with rules equivalent to those of the input presentation, but over a normalised alphabet. If the alphabet of p is \(\{a_0, a_1, \dots, a_{n-1}\}\), then the alphabet of the returned inverse presentation will be \(\{0, 1, \dots, n-1, n, \dots, 2n-1\}\), where the inverse of letter \(i\) is the letter \(i + n\, (\text{mod }2n)\).
| Thing | used for SFINAE, must be InversePresentation. |
| Word | the type of the words in the input presentation. |
| p | the input presentation. |
| LibsemigroupsException | if p.throw_if_bad_alphabet_or_rules() throws. |