![]() |
libsemigroups
v3.0.0
C++ library for semigroups and monoids
|
Defined in todd-coxeter-helpers.hpp
.
This page contains documentation for many helper functions for the ToddCoxeter class. In particular, these functions include versions of several of the member functions of ToddCoxeter (that accept iterators) whose parameters are not iterators, but objects instead. The helpers documented on this page all belong to the namespace todd_coxeter.
Functions | |
template<typename Word> | |
auto | class_by_index (ToddCoxeter< Word > &tc, index_type n) |
Returns a range object containing every word in the congruence class with given index. | |
template<typename Word> | |
auto | class_by_index_no_checks (ToddCoxeter< Word > &tc, index_type n) |
Returns a range object containing every word in the congruence class with given index. | |
template<typename Word> | |
auto | class_of (ToddCoxeter< Word > &tc, char const *w) |
Returns a range object containing every word in the congruence class of a given word. | |
template<typename Word, typename Iterator1, typename Iterator2> | |
auto | class_of (ToddCoxeter< Word > &tc, Iterator1 first, Iterator2 last) |
Returns a range object containing every word in the congruence class of a word given by iterators. | |
template<typename Word, typename Int> | |
auto | class_of (ToddCoxeter< Word > &tc, std::initializer_list< Int > const &w) |
Returns a range object containing every word in the congruence class of a given word. | |
template<typename Word> | |
auto | class_of (ToddCoxeter< Word > &tc, Word const &w) |
Returns a range object containing every word in the congruence class of a given word. | |
template<typename Word> | |
auto | class_of_no_checks (ToddCoxeter< Word > &tc, char const *w) |
Returns a range object containing every word in the congruence class of a given word. | |
template<typename Word, typename Iterator1, typename Iterator2> | |
auto | class_of_no_checks (ToddCoxeter< Word > &tc, Iterator1 first, Iterator2 last) |
Returns a range object containing every word in the congruence class of a word given by iterators. | |
template<typename Word, typename Int> | |
auto | class_of_no_checks (ToddCoxeter< Word > &tc, std::initializer_list< Int > const &w) |
Returns a range object containing every word in the congruence class of a given word. | |
template<typename Word> | |
auto | class_of_no_checks (ToddCoxeter< Word > &tc, Word const &w) |
Returns a range object containing every word in the congruence class of a given word. | |
template<typename Word> | |
index_type | current_index_of (ToddCoxeter< Word > &tc, char const *w) |
Returns the current index of the class containing a word. | |
template<typename Word, typename Int> | |
index_type | current_index_of (ToddCoxeter< Word > &tc, std::initializer_list< Int > const &w) |
Returns the current index of the class containing a word. | |
template<typename Word> | |
index_type | current_index_of (ToddCoxeter< Word > const &tc, Word const &w) |
Returns the current index of the class containing a word. | |
template<typename Word> | |
index_type | current_index_of_no_checks (ToddCoxeter< Word > &tc, char const *w) |
Returns the current index of the class containing a word. | |
template<typename Word, typename Int> | |
index_type | current_index_of_no_checks (ToddCoxeter< Word > &tc, std::initializer_list< Int > const &w) |
Returns the current index of the class containing a word. | |
template<typename Word> | |
index_type | current_index_of_no_checks (ToddCoxeter< Word > const &tc, Word const &w) |
Returns the current index of the class containing a word. | |
template<typename Word> | |
Word | current_word_of (ToddCoxeter< Word > &tc, index_type i) |
Returns a word representing a class with given index. | |
template<typename Word> | |
Word | current_word_of_no_checks (ToddCoxeter< Word > &tc, index_type i) |
Returns a word representing a class with given index. | |
template<typename Word> | |
index_type | index_of (ToddCoxeter< Word > &tc, char const *w) |
Returns the index of the class containing a word. | |
template<typename Word, typename Int> | |
index_type | index_of (ToddCoxeter< Word > &tc, std::initializer_list< Int > const &w) |
Returns the index of the class containing a word. | |
template<typename Word> | |
index_type | index_of (ToddCoxeter< Word > &tc, Word const &w) |
Returns the index of the class containing a word. | |
template<typename Word> | |
index_type | index_of_no_checks (ToddCoxeter< Word > &tc, char const *w) |
Returns the index of the class containing a word. | |
template<typename Word, typename Int> | |
index_type | index_of_no_checks (ToddCoxeter< Word > &tc, std::initializer_list< Int > const &w) |
Returns the index of the class containing a word. | |
template<typename Word> | |
index_type | index_of_no_checks (ToddCoxeter< Word > &tc, Word const &w) |
Returns the index of the class containing a word. | |
tril | is_non_trivial (ToddCoxeter |
Check if the congruence has more than one class. | |
template<typename Word, typename Time> | |
std::vector< Word >::const_iterator | redundant_rule (Presentation< Word > const &p, Time t) |
Return an iterator pointing at the left hand side of a redundant rule. | |
template<typename Word> | |
Word | word_of (ToddCoxeter< Word > &tc, index_type i) |
Returns a word representing a class with given index. | |
template<typename Word> | |
Word | word_of_no_checks (ToddCoxeter< Word > &tc, index_type i) |
Returns a word representing a class with given index. | |
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function returns a range object containing every word in belonging to the class with index n
in the congruence represented by the ToddCoxeter instance tc
. Calls to this function trigger a full enumeration of tc
.
tc | the ToddCoxeter instance. |
n | the index of the class. |
n
.LibsemigroupsException | if n is greater than or equal to tc.number_of_classes() . |
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function returns a range object containing every word in belonging to the class with index n
in the congruence represented by the ToddCoxeter instance tc
. Calls to this function trigger a full enumeration of tc
.
tc | the ToddCoxeter instance. |
n | the index of the class. |
n
.n
is strictly less than tc.number_of_classes()
.
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function returns a range object containing every word in belonging to the same class as the input word w
in the congruence represented by the ToddCoxeter instance tc
. Calls to this function trigger a full enumeration of tc
.
tc | the ToddCoxeter instance. |
w | pointer to first letter. |
LibsemigroupsException | if any of the values pointed at by the iterators is out of range, i.e. they do not belong to presentation().alphabet() and Presentation::validate_word throws. |
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function returns a range object containing every word in belonging to the same class as the word (contained in the range from first
to last
) in the congruence represented by the ToddCoxeter instance tc
. Calls to this function trigger a full enumeration of tc
.
Iterator1 | the type of the 2nd argument first . |
Iterator2 | the type of the 3rd argument last . |
tc | the ToddCoxeter instance. |
first | iterator pointing at the first letter of the word. |
last | iterator pointing one beyond the last letter of the word. |
LibsemigroupsException | if any of the values pointed at by the iterators is out of range, i.e. they do not belong to presentation().alphabet() and Presentation::validate_word throws. |
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function returns a range object containing every word in belonging to the same class as the input word w
in the congruence represented by the ToddCoxeter instance tc
. Calls to this function trigger a full enumeration of tc
.
Int | the type of the letters in the word w . |
tc | the ToddCoxeter instance. |
w | the input word. |
LibsemigroupsException | if any of the values pointed at by the iterators is out of range, i.e. they do not belong to presentation().alphabet() and Presentation::validate_word throws. |
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function returns a range object containing every word in belonging to the same class as the input word w
in the congruence represented by the ToddCoxeter instance tc
. Calls to this function trigger a full enumeration of tc
.
Word | the type of the 2nd argument w . |
tc | the ToddCoxeter instance. |
w | the input word. |
LibsemigroupsException | if any of the values pointed at by the iterators is out of range, i.e. they do not belong to presentation().alphabet() and Presentation::validate_word throws. |
|
inlinenodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function returns a range object containing every word in belonging to the same class as the input word w
in the congruence represented by the ToddCoxeter instance tc
. Calls to this function trigger a full enumeration of tc
.
tc | the ToddCoxeter instance. |
w | pointer to first letter. |
presentation().alphabet()
.
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function returns a range object containing every word in belonging to the same class as the word (contained in the range from first
to last
) in the congruence represented by the ToddCoxeter instance tc
. Calls to this function trigger a full enumeration of tc
.
Iterator1 | the type of the 2nd argument first . |
Iterator2 | the type of the 3rd argument last . |
tc | the ToddCoxeter instance. |
first | iterator pointing at the first letter of the word. |
last | iterator pointing one beyond the last letter of the word. |
presentation().alphabet()
.
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function returns a range object containing every word in belonging to the same class as the input word w
in the congruence represented by the ToddCoxeter instance tc
. Calls to this function trigger a full enumeration of tc
.
Int | the type of the letters in the word w . |
tc | the ToddCoxeter instance. |
w | the input word. |
presentation().alphabet()
.
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function returns a range object containing every word in belonging to the same class as the input word w
in the congruence represented by the ToddCoxeter instance tc
. Calls to this function trigger a full enumeration of tc
.
Word | the type of the 2nd argument w . |
tc | the ToddCoxeter instance. |
w | the input word. |
presentation().alphabet()
.
|
inlinenodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function just calls
See ToddCoxeter::current_index_of for details.
tc | the ToddCoxeter instance. |
w | the word. |
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function just calls
See current_index_of for details.
Int | the type of items in the second argument w . |
tc | the ToddCoxeter instance. |
w | the word. |
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function just calls
See current_index_of for details.
Word | the type of the second argument w . |
tc | the ToddCoxeter instance. |
w | the word. |
|
inlinenodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function just calls
See ToddCoxeter::current_index_of_no_checks for details.
tc | the ToddCoxeter instance. |
w | the word. |
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function just calls
See ToddCoxeter::current_index_of_no_checks for details.
Int | the type of items in the second argument w . |
tc | the ToddCoxeter instance. |
w | the word. |
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function just calls
See ToddCoxeter::current_index_of_no_checks for details.
Word | the type of the second argument w . |
tc | the ToddCoxeter instance. |
w | the word. |
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
See ToddCoxeter::word_of for details.
Word | the type of the returned word (default: word_type). |
tc | the ToddCoxeter instance. |
i | the index of the class. |
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
See ToddCoxeter::word_of_no_checks for details.
Word | the type of the returned word (default: word_type). |
tc | the ToddCoxeter instance. |
i | the index of the class. |
|
inlinenodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function just calls
See ToddCoxeter::index_of for details.
tc | the ToddCoxeter instance. |
w | the word. |
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function just calls
See index_of for details.
Int | the type of items in the second argument w . |
tc | the ToddCoxeter instance. |
w | the word. |
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function just calls
See index_of for details.
Word | the type of the second argument w . |
tc | the ToddCoxeter instance. |
w | the word. |
|
inlinenodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function just calls
See ToddCoxeter::index_of_no_checks for details.
tc | the ToddCoxeter instance. |
w | the word. |
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function just calls
See index_of_no_checks for details.
Int | the type of items in the second argument w . |
tc | the ToddCoxeter instance. |
w | the word. |
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
This function just calls
See ToddCoxeter::index_of_no_checks for details.
Word | the type of the second argument w . |
tc | the ToddCoxeter instance. |
w | the word. |
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
Returns tril::TRUE if it is possible to show that the congruence is non-trivial; tril::FALSE if the congruence is already known to be trivial; and tril::unknown if it is not possible to show that the congruence is non-trivial.
This function attempts to find a non-trivial congruence containing the congruence represented by a ToddCoxeter instance by repeating the following steps on a copy until the enumeration concludes:
threshold
times the initial number of nodes for this step.If at the end of this process, the ToddCoxeter instance is non-trivial, then the original ToddCoxeter is also non-trivial. Otherwise, the entire process is repeated again up to a total of tries
times.
tc | the ToddCoxeter instance. |
tries | the number of attempts to find non-trivial super-congruence. |
try_for | the amount of time in millisecond to enumerate the congruence after choosing a random pair of representatives and identifying them. |
threshold | the threshold (see description). |
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
Starting with the last rule in the presentation, this function attempts to run the Todd-Coxeter algorithm on the rules of the presentation except for a given omitted rule. For every such omitted rule, Todd-Coxeter is run for the length of time indicated by the second parameter t
, and then it is checked if the omitted rule can be shown to be redundant.
If the omitted rule can be shown to be redundant in this way, then an iterator pointing to its left hand side is returned.
If no rule can be shown to be redundant in this way, then an iterator pointing to p.rules.cend()
is returned.
Word | type of words in the Presentation. |
Time | type of the 2nd parameter (time to try running Todd-Coxeter). |
p | the presentation. |
t | time to run Todd-Coxeter for every omitted rule. |
p.rules.cend()
.
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
See ToddCoxeter::word_of for details.
Word | the type of the returned word (default: word_type). |
tc | the ToddCoxeter instance. |
i | the index of the class. |
|
nodiscard |
Defined in todd-coxeter-helpers.hpp
.
See ToddCoxeter::word_of_no_checks for details.
Word | the type of the returned word (default: word_type). |
tc | the ToddCoxeter instance. |
i | the index of the class. |