23#ifndef LIBSEMIGROUPS_DETAIL_KE_HPP_
24#define LIBSEMIGROUPS_DETAIL_KE_HPP_
31#include "libsemigroups/adapters.hpp"
32#include "libsemigroups/constants.hpp"
33#include "libsemigroups/froidure-pin.hpp"
34#include "libsemigroups/kambites-class.hpp"
35#include "libsemigroups/order.hpp"
36#include "libsemigroups/presentation.hpp"
37#include "libsemigroups/types.hpp"
38#include "libsemigroups/word-range.hpp"
44 template <
typename Word>
54 KE(KE
const&) =
default;
56 KE& operator=(KE
const&) =
default;
57 KE& operator=(KE&&) =
default;
60 KE(Kambites<Word>& k, value_type
const& w) : _value() {
68 : KE(k, value_type({k.presentation().letter_no_checks(a)})) {}
70 bool operator==(KE
const& that)
const {
71 return that._value == this->_value;
74 bool operator<(KE
const& that)
const {
82 value_type
const& value() const noexcept {
86 word_type to_word(Kambites<Word>
const& k)
const {
87 ToWord to_word(k.presentation().alphabet());
88 return to_word(_value);
91 template <
typename SFINAE = std::
string>
92 auto to_string() const noexcept
93 -> std::enable_if_t<!std::is_same_v<Word,
word_type>, SFINAE> {
104 static_assert(!std::is_trivial<KE<std::string>>::value,
105 "KE is not trivial!!!");
107 std::integral_constant<bool, (
sizeof(KE<std::string>) <= 32)>::value,
108 "KE's sizeof exceeds 32!!");
112 template <
typename Word>
113 struct FroidurePinState<detail::KE<Word>> {
114 using type = Kambites<Word>;
121 template <
typename Word>
123 constexpr size_t operator()(detail::KE<Word>
const&)
const noexcept {
128 template <
typename Word>
129 struct Degree<detail::KE<Word>> {
130 constexpr size_t operator()(detail::KE<Word>
const&)
const noexcept {
135 template <
typename Word>
137 void operator()(detail::KE<Word>
const&,
size_t)
const noexcept {}
140 template <
typename Word>
141 struct One<detail::KE<Word>> {
142 detail::KE<Word> operator()(detail::KE<Word>
const&) {
143 return detail::KE<Word>();
146 detail::KE<Word> operator()(
size_t = 0)
const {
147 return detail::KE<Word>();
151 template <
typename Word>
152 struct Product<detail::KE<Word>> {
153 void operator()(detail::KE<Word>& xy,
154 detail::KE<Word>
const& x,
155 detail::KE<Word>
const& y,
158 using value_type =
typename detail::KE<Word>::value_type;
159 using words::operator+=;
160 value_type w(x.value());
162 xy = detail::KE<Word>(*k, w);
166#ifndef LIBSEMIGROUPS_PARSED_BY_DOXYGEN
190 Kambites<std::string>>>::is_finite()
const;
196 Kambites<detail::MultiStringView>>>::is_finite()
202 Kambites<word_type>>>::is_finite()
const;
230 template <
typename Word>
231 struct hash<libsemigroups::detail::KE<Word>> {
232 size_t operator()(libsemigroups::detail::KE<Word>
const& x)
const {
233 using value_type =
typename libsemigroups::detail::KE<Word>::value_type;
238 template <
typename Word>
239 struct equal_to<libsemigroups::detail::KE<Word>> {
240 bool operator()(libsemigroups::detail::KE<Word>
const& x,
241 libsemigroups::detail::KE<Word>
const& y)
const {
T back_inserter(T... args)
Class implementing the Froidure-Pin algorithm.
Definition froidure-pin.hpp:188
LimitMax const LIMIT_MAX
Value for the maximum of something.
Kambites(congruence_kind, Presentation< Word > const &) -> Kambites< Word >
Deduction guide.
std::conditional_t< std::is_same_v< Word, detail::MultiStringView >, std::string, Word > native_word_type
Type of the words in the relations of the presentation stored in a Kambites instance.
Definition kambites-class.hpp:164
bool shortlex_compare(T const &first1, T const &last1, T const &first2, T const &last2)
Compare two objects of the same type using the short-lex reduction ordering.
Definition order.hpp:267
std::vector< letter_type > word_type
Type for a word over the generators of a semigroup.
Definition types.hpp:101
size_t letter_type
Type for the index of a generator of a semigroup.
Definition types.hpp:98
tril
Enum to indicate true, false or not currently knowable.
Definition types.hpp:56
Namespace for everything in the libsemigroups library.
Definition action.hpp:44
Adapter for the complexity of multiplication.
Definition adapters.hpp:121
Adapter for the degree of an element.
Definition adapters.hpp:159
Traits class for FroidurePin.
Definition froidure-pin.hpp:68
Adapter for increasing the degree of an element.
Definition adapters.hpp:199
Adapter for the identity element of the given type.
Definition adapters.hpp:246
Adapter for the product of two elements.
Definition adapters.hpp:284