Skip to content

Commit 7717a5e

Browse files
committed
to: add Kambites -> Presentation
1 parent b45e6f3 commit 7717a5e

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

src/to-presentation.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <string> // for string, basic_string, oper...
2222

2323
#include <libsemigroups/froidure-pin-base.hpp> // for FroidurePinBase
24+
#include <libsemigroups/kambites.hpp> // for Kambites
2425
#include <libsemigroups/knuth-bendix-class.hpp> // for KnuthBendix
2526
#include <libsemigroups/presentation.hpp> // for Presentation
2627
#include <libsemigroups/to-presentation.hpp> // for to<Presentation>
@@ -101,6 +102,13 @@ namespace libsemigroups {
101102
typename InversePresentation<InputWord>::letter_type)>&&
102103
f) { return to<InversePresentation<OutputWord>>(ip, f); });
103104
}
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+
}
104112
} // namespace
105113

106114
void init_to_present(py::module& m) {
@@ -148,6 +156,15 @@ namespace libsemigroups {
148156
bind_fp_to_pres<std::string>(m, "string");
149157
bind_fp_to_pres<word_type>(m, "word");
150158

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+
151168
////////////////////////////////////////////////////////////////////////////
152169
// to<InversePresentation>
153170
////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)