libsemigroups  v3.3.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 "is-transf.hpp" // for detail::throw_if_not_transf
29#include "kambites-class.hpp" // for Kambites
30#include "knuth-bendix-class.hpp" // for KnuthBendix
31#include "konieczny.hpp" // for Konieczny
32#include "todd-coxeter-class.hpp" // for ToddCoxeter
33
34#include "detail/kbe.hpp" // for KBE
35#include "detail/ke.hpp" // for KE
36#include "detail/tce.hpp" // for TCE
37
38namespace libsemigroups {
39
68
79
81 // Congruence
83
107 template <template <typename...> typename Thing, typename Word>
108 auto to(Congruence<Word>& cong)
109 -> std::enable_if_t<std::is_same_v<Thing<int>, FroidurePin<int>>,
111
113 // Kambites
115
144 template <template <typename...> typename Thing, typename Word>
145 auto to(Kambites<Word>& k) -> std::enable_if_t<
146 std::is_same_v<Thing<detail::KE<Word>>, FroidurePin<detail::KE<Word>>>,
148
150 // KnuthBendix
152
179 template <template <typename...> typename Thing,
180 typename Word,
181 typename Rewriter,
182 typename ReductionOrder>
183 auto to(KnuthBendix<Word, Rewriter, ReductionOrder>& kb) -> std::enable_if_t<
184 std::is_same_v<Thing<int>, FroidurePin<int>>,
186
210 template <template <typename...> typename Thing,
211 typename Element,
212 typename Traits>
214 -> std::enable_if_t<std::is_same_v<Thing<int>, FroidurePin<int>>,
216
218 // ToddCoxeter
220
249 template <template <typename...> typename Thing>
250 auto to(detail::ToddCoxeterImpl& tc) -> std::enable_if_t<
251 std::is_same_v<Thing<detail::TCE>, FroidurePin<detail::TCE>>,
253
255 // WordGraph
257
315 template <typename Result, typename Node>
316 auto to(WordGraph<Node> const& wg, size_t first, size_t last)
317 -> std::enable_if_t<
318 std::is_same_v<FroidurePin<typename Result::element_type>, Result>,
319 Result>;
320
329 template <typename Result, typename Node>
330 auto to(WordGraph<Node> const& wg) -> std::enable_if_t<
331 std::is_same_v<FroidurePin<typename Result::element_type>, Result>,
332 Result> {
333 return to<Result>(wg, 0, wg.number_of_nodes());
334 }
335} // namespace libsemigroups
336
337#include "to-froidure-pin.tpp"
338#endif // LIBSEMIGROUPS_TO_FROIDURE_PIN_HPP_
Class implementing the Froidure-Pin algorithm.
Definition froidure-pin.hpp:190
Class implementing Konieczny's algorithm.
Definition konieczny.hpp:178
Class for representing word graphs.
Definition word-graph.hpp:83
Namespace for everything in the libsemigroups library.
Definition action.hpp:44
auto to(detail::KnuthBendixImpl< Rewriter, ReductionOrder > &kb) -> std::enable_if_t< std::is_same_v< Presentation< typename Result::word_type >, Result >, Result >
No doc.