Skip to content

Commit 111a4b5

Browse files
codexjames-d-mitchell
authored andcommitted
order: add support for Alphabet
1 parent 6207126 commit 111a4b5

6 files changed

Lines changed: 230 additions & 156 deletions

File tree

src/froidure-pin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@ This function returns the element of *fp* obtained by evaluating *w*.
12691269
});
12701270
}
12711271
} // bind_froidure_pin_stateful
1272-
} // namespace
1272+
} // namespace
12731273

12741274
void init_froidure_pin(py::module& m) {
12751275
using LenLexTrie = detail::RewritingSystemTrie<LenLexCmp>;

src/knuth-bendix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ Copy a :any:`NormalFormRange` object.
388388
});
389389
thing.def("next", [](NormalFormRange& nfr) { nfr.next(); });
390390
} // bind_normal_form_range
391-
} // namespace
391+
} // namespace
392392

393393
template <typename Word>
394394
void bind_redundant_rule(py::module& m) {

src/libsemigroups_pybind11/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
from .bipartition import Bipartition
4242
from .blocks import Blocks
4343
from .congruence import Congruence
44+
from .detail.cxx_wrapper import wrap_cxx_free_fn as _wrap_cxx_free_fn
4445
from .detail.dot import Dot
4546
from .forest import PathsFromRoots, PathsToRoots
4647
from .froidure_pin import FroidurePin
@@ -103,12 +104,16 @@
103104
delta,
104105
error_message_with_prefix,
105106
freeband_equal_to,
107+
lenlex_cmp as _lenlex_cmp,
108+
lex_cmp as _lex_cmp,
106109
lexicographical_compare,
107110
number_of_words,
108111
random_string,
109112
random_strings,
110113
random_word,
111114
recursive_path_compare,
115+
rev_rpo_cmp as _rev_rpo_cmp,
116+
rpo_cmp as _rpo_cmp,
112117
shortlex_compare,
113118
side,
114119
tril,
@@ -120,6 +125,12 @@
120125
) from e
121126

122127

128+
lenlex_cmp = _wrap_cxx_free_fn(_lenlex_cmp)
129+
lex_cmp = _wrap_cxx_free_fn(_lex_cmp)
130+
rev_rpo_cmp = _wrap_cxx_free_fn(_rev_rpo_cmp)
131+
rpo_cmp = _wrap_cxx_free_fn(_rpo_cmp)
132+
133+
123134
__all__ = [
124135
"__version__",
125136
# Constants from _libsemigruops_pybind11
@@ -158,12 +169,16 @@
158169
"delta",
159170
"error_message_with_prefix",
160171
"freeband_equal_to",
172+
"lenlex_cmp",
173+
"lex_cmp",
161174
"lexicographical_compare",
162175
"number_of_words",
163176
"random_string",
164177
"random_strings",
165178
"random_word",
166179
"recursive_path_compare",
180+
"rev_rpo_cmp",
181+
"rpo_cmp",
167182
"shortlex_compare",
168183
"side",
169184
"tril",

src/main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ namespace libsemigroups {
6868

6969
// Must be before most things
7070
init_constants(m);
71+
// The alphabet-aware order comparison overloads require the Alphabet
72+
// classes to be registered before their signatures are created.
73+
init_alphabet(m);
7174
init_order(m);
7275
init_types(m);
7376

@@ -76,7 +79,6 @@ namespace libsemigroups {
7679
init_runner(m);
7780

7881
// Must be before cong classes
79-
init_alphabet(m);
8082
init_present(m);
8183
init_inverse_present(m);
8284

0 commit comments

Comments
 (0)