Skip to content

Commit 44ed1c3

Browse files
james-d-mitchellcodexJoseph-Edwards
authored
Add order objects (#474)
* order: add support for LenLexCmp * order: support RPOCmp * order: support RevRPOCmp * order: support RevLexCmp * order: support RevLenLexCmp * order: support WrCmp * order: support RevWrCmp * order: support WtLenLexCmp * order: support RevWtLenLexCmp * order: support WtLexCmp * order: support RevWtLexCmp * order: support LenWtLexCmp * order: support RevLenWtLexCmp * dnr: disable lint warning * order: reorg file * Doc fixes * order: final doc fixes * Suppress lint warning * Updates from code review * order: doc further improve the wording * order: remove unused header * order: reorganise tests * Apply suggestions from code review Co-authored-by: Joe Edwards <80713360+Joseph-Edwards@users.noreply.github.com> * Format + lint * order: allow strings for all Default Cmp structs * order: remove deprecated enum value from doctest * lint + format --------- Co-authored-by: Codex OpenAI <codex@openai.com> Co-authored-by: Joe Edwards <80713360+Joseph-Edwards@users.noreply.github.com>
1 parent ce95ef9 commit 44ed1c3

21 files changed

Lines changed: 4254 additions & 238 deletions
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
..
2+
Copyright (c) 2026 Joseph Edwards, J. D. Mitchell
3+
4+
Distributed under the terms of the GPL license version 3.
5+
6+
The full license is in the file LICENSE, distributed with this software.
7+
8+
.. currentmodule:: libsemigroups_pybind11
9+
10+
Functions for orders
11+
====================
12+
13+
This page contains the documentation for functions that compare lists of
14+
integers ``list[int]`` or strings ``str`` with respect to certain reduction
15+
orderings.
16+
17+
.. important::
18+
19+
The following functions are deprecated in v1.5.0 and will be removed v2.0.0:
20+
21+
* ``lexicographical_compare``, please use :any:`lex_cmp` instead.
22+
* ``recursive_path_compare`` please use :any:`rev_rpo_cmp` instead.
23+
* ``shortlex_compare`` please use :any:`lenlex_cmp` instead.
24+
25+
Contents
26+
--------
27+
28+
.. autosummary::
29+
:signatures: short
30+
31+
len_wt_lex_cmp
32+
lenlex_cmp
33+
lex_cmp
34+
rev_len_wt_lex_cmp
35+
rev_lenlex_cmp
36+
rev_lex_cmp
37+
rev_rpo_cmp
38+
rev_wr_cmp
39+
rev_wt_lenlex_cmp
40+
rev_wt_lex_cmp
41+
rpo_cmp
42+
wr_cmp
43+
wt_lenlex_cmp
44+
wt_lex_cmp
45+
46+
Full API
47+
--------
48+
49+
.. autofunction:: len_wt_lex_cmp
50+
51+
.. autofunction:: lenlex_cmp
52+
53+
.. autofunction:: lex_cmp
54+
55+
.. autofunction:: rev_len_wt_lex_cmp
56+
57+
.. autofunction:: rev_lenlex_cmp
58+
59+
.. autofunction:: rev_lex_cmp
60+
61+
.. autofunction:: rev_rpo_cmp
62+
63+
.. autofunction:: rev_wr_cmp
64+
65+
.. autofunction:: rev_wt_lenlex_cmp
66+
67+
.. autofunction:: rev_wt_lex_cmp
68+
69+
.. autofunction:: rpo_cmp
70+
71+
.. autofunction:: wr_cmp
72+
73+
.. autofunction:: wt_lenlex_cmp
74+
75+
.. autofunction:: wt_lex_cmp

docs/source/data-structures/order/index.rst

Lines changed: 24 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -10,70 +10,33 @@
1010
Orders
1111
======
1212

13-
This page contains the documentation for several functions for comparing words
14-
or strings with respect to certain reduction orderings.
13+
This page contains the documentation for classes and several functions for
14+
comparing words (i.e. lists of integers ``list[int]`` or strings ``str``) with
15+
respect to certain reduction orderings.
1516

1617
.. seealso::
1718

1819
- :any:`Order`
1920
- :any:`Alphabet`
2021

21-
.. important::
22-
23-
The following functions are deprecated in v1.5.0 and will be removed v2.0.0:
24-
25-
* ``lexicographical_compare``, please use :any:`lex_cmp` instead.
26-
* ``recursive_path_compare`` please use :any:`rev_rpo_cmp` instead.
27-
* ``shortlex_compare`` please use :any:`lenlex_cmp` instead.
28-
29-
Contents
30-
--------
31-
32-
.. autosummary::
33-
:signatures: short
34-
35-
len_wt_lex_cmp
36-
lenlex_cmp
37-
lex_cmp
38-
rev_len_wt_lex_cmp
39-
rev_lenlex_cmp
40-
rev_lex_cmp
41-
rev_rpo_cmp
42-
rev_wr_cmp
43-
rev_wt_lenlex_cmp
44-
rev_wt_lex_cmp
45-
rpo_cmp
46-
wr_cmp
47-
wt_lenlex_cmp
48-
wt_lex_cmp
49-
50-
Full API
51-
--------
52-
53-
.. autofunction:: len_wt_lex_cmp
54-
55-
.. autofunction:: lenlex_cmp
56-
57-
.. autofunction:: lex_cmp
58-
59-
.. autofunction:: rev_len_wt_lex_cmp
60-
61-
.. autofunction:: rev_lenlex_cmp
62-
63-
.. autofunction:: rev_lex_cmp
64-
65-
.. autofunction:: rev_rpo_cmp
66-
67-
.. autofunction:: rev_wr_cmp
68-
69-
.. autofunction:: rev_wt_lenlex_cmp
70-
71-
.. autofunction:: rev_wt_lex_cmp
72-
73-
.. autofunction:: rpo_cmp
74-
75-
.. autofunction:: wr_cmp
76-
77-
.. autofunction:: wt_lenlex_cmp
78-
79-
.. autofunction:: wt_lex_cmp
22+
The classes and functions in ``libsemigroups_pybind11`` for comparing words
23+
are described on the following pages:
24+
25+
.. toctree::
26+
:maxdepth: 1
27+
28+
lex-cmp
29+
rev-lex-cmp
30+
lenlex-cmp
31+
rev-lenlex-cmp
32+
rpo-cmp
33+
rev-rpo-cmp
34+
wr-cmp
35+
rev-wr-cmp
36+
wt-lenlex-cmp
37+
rev-wt-lenlex-cmp
38+
wt-lex-cmp
39+
rev-wt-lex-cmp
40+
len-wt-lex-cmp
41+
rev-len-wt-lex-cmp
42+
functions
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
..
2+
Copyright (c) 2026 J. D. Mitchell
3+
4+
Distributed under the terms of the GPL license version 3.
5+
6+
The full license is in the file LICENSE, distributed with this software.
7+
8+
.. currentmodule:: libsemigroups_pybind11
9+
10+
The LenWtLexCmp class
11+
=====================
12+
13+
.. autoclass:: LenWtLexCmp
14+
:doc-only:
15+
16+
Contents
17+
--------
18+
19+
.. autosummary::
20+
:signatures: short
21+
22+
~LenWtLexCmp
23+
LenWtLexCmp.__call__
24+
LenWtLexCmp.alphabet
25+
LenWtLexCmp.copy
26+
LenWtLexCmp.init
27+
LenWtLexCmp.weights
28+
29+
Full API
30+
--------
31+
32+
.. autoclass:: LenWtLexCmp
33+
:class-doc-from: init
34+
:special-members: __call__
35+
:members:
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
..
2+
Copyright (c) 2026 J. D. Mitchell
3+
4+
Distributed under the terms of the GPL license version 3.
5+
6+
The full license is in the file LICENSE, distributed with this software.
7+
8+
.. currentmodule:: libsemigroups_pybind11
9+
10+
The LenLexCmp class
11+
===================
12+
13+
.. autoclass:: LenLexCmp
14+
:doc-only:
15+
16+
Contents
17+
--------
18+
19+
.. autosummary::
20+
:signatures: short
21+
22+
~LenLexCmp
23+
LenLexCmp.__call__
24+
LenLexCmp.alphabet
25+
LenLexCmp.copy
26+
LenLexCmp.init
27+
28+
Full API
29+
--------
30+
31+
.. autoclass:: LenLexCmp
32+
:class-doc-from: init
33+
:special-members: __call__
34+
:members:
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
..
2+
Copyright (c) 2026 J. D. Mitchell
3+
4+
Distributed under the terms of the GPL license version 3.
5+
6+
The full license is in the file LICENSE, distributed with this software.
7+
8+
.. currentmodule:: libsemigroups_pybind11
9+
10+
The LexCmp class
11+
================
12+
13+
.. autoclass:: LexCmp
14+
:doc-only:
15+
16+
Contents
17+
--------
18+
19+
.. autosummary::
20+
:signatures: short
21+
22+
~LexCmp
23+
LexCmp.__call__
24+
LexCmp.alphabet
25+
LexCmp.copy
26+
LexCmp.init
27+
28+
Full API
29+
--------
30+
31+
.. autoclass:: LexCmp
32+
:class-doc-from: init
33+
:special-members: __call__
34+
:members:
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
..
2+
Copyright (c) 2026 J. D. Mitchell
3+
4+
Distributed under the terms of the GPL license version 3.
5+
6+
The full license is in the file LICENSE, distributed with this software.
7+
8+
.. currentmodule:: libsemigroups_pybind11
9+
10+
The RevLenWtLexCmp class
11+
========================
12+
13+
.. autoclass:: RevLenWtLexCmp
14+
:doc-only:
15+
16+
Contents
17+
--------
18+
19+
.. autosummary::
20+
:signatures: short
21+
22+
~RevLenWtLexCmp
23+
RevLenWtLexCmp.__call__
24+
RevLenWtLexCmp.alphabet
25+
RevLenWtLexCmp.copy
26+
RevLenWtLexCmp.init
27+
RevLenWtLexCmp.weights
28+
29+
Full API
30+
--------
31+
32+
.. autoclass:: RevLenWtLexCmp
33+
:class-doc-from: init
34+
:special-members: __call__
35+
:members:
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
..
2+
Copyright (c) 2026 J. D. Mitchell
3+
4+
Distributed under the terms of the GPL license version 3.
5+
6+
The full license is in the file LICENSE, distributed with this software.
7+
8+
.. currentmodule:: libsemigroups_pybind11
9+
10+
The RevLenLexCmp class
11+
======================
12+
13+
.. autoclass:: RevLenLexCmp
14+
:doc-only:
15+
16+
Contents
17+
--------
18+
19+
.. autosummary::
20+
:signatures: short
21+
22+
~RevLenLexCmp
23+
RevLenLexCmp.__call__
24+
RevLenLexCmp.alphabet
25+
RevLenLexCmp.copy
26+
RevLenLexCmp.init
27+
28+
Full API
29+
--------
30+
31+
.. autoclass:: RevLenLexCmp
32+
:class-doc-from: init
33+
:special-members: __call__
34+
:members:
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
..
2+
Copyright (c) 2026 J. D. Mitchell
3+
4+
Distributed under the terms of the GPL license version 3.
5+
6+
The full license is in the file LICENSE, distributed with this software.
7+
8+
.. currentmodule:: libsemigroups_pybind11
9+
10+
The RevLexCmp class
11+
===================
12+
13+
.. autoclass:: RevLexCmp
14+
:doc-only:
15+
16+
Contents
17+
--------
18+
19+
.. autosummary::
20+
:signatures: short
21+
22+
~RevLexCmp
23+
RevLexCmp.__call__
24+
RevLexCmp.alphabet
25+
RevLexCmp.copy
26+
RevLexCmp.init
27+
28+
Full API
29+
--------
30+
31+
.. autoclass:: RevLexCmp
32+
:class-doc-from: init
33+
:special-members: __call__
34+
:members:

0 commit comments

Comments
 (0)