libsemigroups  v3.0.0
C++ library for semigroups and monoids
Loading...
Searching...
No Matches
to-froidure-pin.hpp
1//
2// libsemigroups - C++ library for semigroups and monoids
3// Copyright (C) 2022-2025 James D. Mitchell
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <http://www.gnu.org/licenses/>.
17//
18
19#ifndef LIBSEMIGROUPS_TO_FROIDURE_PIN_HPP_
20#define LIBSEMIGROUPS_TO_FROIDURE_PIN_HPP_
21
22#include <cstddef> // for size_t
23#include <memory> // for unique_ptr
24#include <type_traits> // for enable_if_t, is_base_of
25
26#include "cong-class.hpp" // for Congruence
27#include "froidure-pin.hpp" // for FroidurePin
28#include "kambites-class.hpp" // for Kambites
29#include "knuth-bendix-class.hpp" // for KnuthBendix
30#include "konieczny.hpp" // for Konieczny
31#include "todd-coxeter-class.hpp" // for ToddCoxeter
32
33#include "detail/kbe.hpp" // for KBE
34#include "detail/ke.hpp" // for KE
35#include "detail/tce.hpp" // for TCE
36
37namespace libsemigroups {
38
65
76
78 // Congruence
80
104 template <template <typename...> typename Thing, typename Word>
105 auto to(Congruence<Word>& cong)
106 -> std::enable_if_t<std::is_same_v<Thing<int>, FroidurePin<int>>,
108
110 // Kambites
112
141 template <template <typename...> typename Thing, typename Word>
142 auto to(Kambites<Word>& k) -> std::enable_if_t<
143 std::is_same_v<Thing<detail::KE<Word>>, FroidurePin<detail::KE<Word>>>,
145
147 // KnuthBendix
149
176 template <template <typename...> typename Thing,
177 typename Rewriter,
178 typename ReductionOrder>
179 auto to(detail::KnuthBendixImpl<Rewriter, ReductionOrder>& kb)
180 -> std::enable_if_t<
181 std::is_same_v<Thing<int>, FroidurePin<int>>,
183 detail::KBE<detail::KnuthBendixImpl<Rewriter, ReductionOrder>>>>;
184
208 template <template <typename...> typename Thing,
209 typename Element,
210 typename Traits>
212 -> std::enable_if_t<std::is_same_v<Thing<int>, FroidurePin<int>>,
214
216 // ToddCoxeter
218
247 template <template <typename...> typename Thing>
248 auto to(detail::ToddCoxeterImpl& tc) -> std::enable_if_t<
249 std::is_same_v<Thing<detail::TCE>, FroidurePin<detail::TCE>>,
251
253 // WordGraph
255
313 template <typename Result, typename Node>
314 auto to(WordGraph<Node> const& wg, size_t first, size_t last)
315 -> std::enable_if_t<
316 std::is_same_v<FroidurePin<typename Result::element_type>, Result>,
317 Result>;
318
327 template <typename Result, typename Node>
328 auto to(WordGraph<Node> const& wg) -> std::enable_if_t<
329 std::is_same_v<FroidurePin<typename Result::element_type>, Result>,
330 Result> {
331 return to<Result>(wg, 0, wg.number_of_nodes());
332 }
333} // namespace libsemigroups
334
335#include "to-froidure-pin.tpp"
336#endif // LIBSEMIGROUPS_TO_FROIDURE_PIN_HPP_
Class implementing the Froidure-Pin algorithm.
Definition froidure-pin.hpp:188
Class implementing Konieczny's algorithm.
Definition konieczny.hpp:179
Class for representing word graphs.
Definition word-graph.hpp:82
auto to(detail::KnuthBendixImpl< Rewriter, ReductionOrder > &kb) -> std::enable_if_t< std::is_same_v< Presentation< typename Result::word_type >, Result >, Result >
No doc.
Namespace for everything in the libsemigroups library.
Definition action.hpp:44