This page documents the constructors and initialisers for the KnuthBendix class.
Every constructor (except the move + copy constructors, and the move and copy assignment operators) has a matching init
function with the same signature that can be used to re-initialize a KnuthBendix instance as if it had just been constructed; but without necessarily releasing any previous allocated memory.
◆ KnuthBendix() [1/4]
template<typename Word, typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
This function default constructs an uninitialised KnuthBendix instance.
◆ KnuthBendix() [2/4]
template<typename Word, typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
This function constructs a KnuthBendix instance representing a congruence of kind knd
over the semigroup or monoid defined by the presentation p
.
- Parameters
-
knd | the kind (onesided or twosided) of the congruence. |
p | the presentation. |
- Exceptions
-
◆ KnuthBendix() [3/4]
template<typename Word, typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
KnuthBendix |
( |
KnuthBendix< Word, Rewriter, ReductionOrder > && | | ) |
|
◆ KnuthBendix() [4/4]
template<typename Word, typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
KnuthBendix |
( |
KnuthBendix< Word, Rewriter, ReductionOrder > const & | that | ) |
|
Copy constructor.
- Parameters
-
- Complexity
- \(O(n)\) where \(n\) is the sum of the lengths of the words in rules of
that
.
◆ init() [1/2]
template<typename Word, typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
This function clears the rewriter, presentation, settings and stats from the KnuthBendix object, putting it back into the state it would be in if it was newly default constructed.
- Returns
- A reference to
this
.
◆ init() [2/2]
template<typename Word, typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
This function puts a KnuthBendix instance back into the state that it would have been in if it had just been newly constructed from knd
and p
.
- Parameters
-
knd | the kind (onesided or twosided) of the congruence. |
p | the presentation. |
- Returns
- A reference to
*this
.
- Exceptions
-
◆ operator=() [1/2]
template<typename Word, typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
Move assignment operator.
◆ operator=() [2/2]
template<typename Word, typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
Copy assignment operator.
◆ throw_if_letter_not_in_alphabet()
template<typename Word, typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
template<typename Iterator1, typename Iterator2>
void throw_if_letter_not_in_alphabet |
( |
Iterator1 | first, |
|
|
Iterator2 | last ) const |
|
inline |
This function throws a LibsemigroupsException if any value pointed at by an iterator in the range first
to last
is out of bounds (i.e. does not belong to the alphabet of the presentation used to construct the KnuthBendix instance).
- Template Parameters
-
Iterator1 | the type of first argument first . |
Iterator2 | the type of second argument last . |
- Parameters
-
first | iterator pointing at the first letter of the word. |
last | iterator pointing one beyond the last letter of the word. |
- Exceptions
-