|
21 | 21 | #include <string> // for string, basic_string, oper... |
22 | 22 |
|
23 | 23 | #include <libsemigroups/froidure-pin-base.hpp> // for FroidurePinBase |
| 24 | +#include <libsemigroups/kambites.hpp> // for Kambites |
24 | 25 | #include <libsemigroups/knuth-bendix-class.hpp> // for KnuthBendix |
25 | 26 | #include <libsemigroups/presentation.hpp> // for Presentation |
26 | 27 | #include <libsemigroups/to-presentation.hpp> // for to<Presentation> |
@@ -101,6 +102,13 @@ namespace libsemigroups { |
101 | 102 | typename InversePresentation<InputWord>::letter_type)>&& |
102 | 103 | f) { return to<InversePresentation<OutputWord>>(ip, f); }); |
103 | 104 | } |
| 105 | + |
| 106 | + template <typename WordIn, typename WordOut> |
| 107 | + void bind_kambites_to_pres(py::module& m, std::string const& name) { |
| 108 | + std::string fn_name = std::string("to_presentation_") + name; |
| 109 | + m.def(fn_name.c_str(), |
| 110 | + [](Kambites<WordIn>& k) { return to<Presentation<WordOut>>(k); }); |
| 111 | + } |
104 | 112 | } // namespace |
105 | 113 |
|
106 | 114 | void init_to_present(py::module& m) { |
@@ -148,6 +156,15 @@ namespace libsemigroups { |
148 | 156 | bind_fp_to_pres<std::string>(m, "string"); |
149 | 157 | bind_fp_to_pres<word_type>(m, "word"); |
150 | 158 |
|
| 159 | + // From Kambites |
| 160 | + bind_kambites_to_pres<std::string, word_type>(m, "word"); |
| 161 | + bind_kambites_to_pres<std::string, std::string>(m, "string"); |
| 162 | + bind_kambites_to_pres<word_type, word_type>(m, "word"); |
| 163 | + bind_kambites_to_pres<word_type, std::string>(m, "string"); |
| 164 | + bind_kambites_to_pres<detail::MultiView<std::string>, word_type>(m, "word"); |
| 165 | + bind_kambites_to_pres<detail::MultiView<std::string>, std::string>( |
| 166 | + m, "string"); |
| 167 | + |
151 | 168 | //////////////////////////////////////////////////////////////////////////// |
152 | 169 | // to<InversePresentation> |
153 | 170 | //////////////////////////////////////////////////////////////////////////// |
|
0 commit comments