Skip to content

Commit 94d2b44

Browse files
paths: update for fixes in libsemigroups
1 parent 86d7f69 commit 94d2b44

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

src/knuth-bendix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ construct *kb*. This function triggers a full enumeration of *kb*.
207207
>>> kb = KnuthBendix(congruence_kind.twosided, p)
208208
>>> kb.number_of_classes()
209209
+∞
210-
>>> list(knuth_bendix.normal_forms(kb).min(1).max(3))
210+
>>> list(knuth_bendix.normal_forms(kb).min(1).max(2))
211211
['a', 'b', 'c', 'aa', 'ab', 'ac', 'ba', 'bb', 'bc', 'ca', 'cb', 'cc']
212212
)pbdoc");
213213

src/paths.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ The valid values are:
451451
m.def(
452452
"paths_number_of_paths_algorithm",
453453
[](WordGraph<node_type> const& wg, node_type source) {
454-
return number_of_paths_algorithm(wg, source);
454+
return v4::paths::number_of_paths_algorithm(wg, source);
455455
},
456456
py::arg("wg"),
457457
py::arg("source"),
@@ -481,7 +481,7 @@ with the same arguments.
481481
node_type source,
482482
size_t min,
483483
int_or_constant<size_t> max) {
484-
return number_of_paths_algorithm(
484+
return v4::paths::number_of_paths_algorithm(
485485
wg, source, min, to_int<size_t>(max));
486486
},
487487
py::arg("wg"),
@@ -524,7 +524,7 @@ the range ``[min, max)``.
524524
node_type target,
525525
size_t min,
526526
int_or_constant<size_t> max) {
527-
return number_of_paths_algorithm(
527+
return v4::paths::number_of_paths_algorithm(
528528
wg, source, target, min, to_int<size_t>(max));
529529
},
530530
py::arg("wg"),
@@ -567,7 +567,7 @@ ending at the given target node with length in the range ``[min, max)``.
567567
m.def(
568568
"paths_number_of_paths",
569569
[](WordGraph<node_type> const& wg, node_type source) {
570-
return from_int(number_of_paths(wg, source));
570+
return from_int(v4::paths::number_of_paths(wg, source));
571571
},
572572
py::arg("wg"),
573573
py::arg("source"),
@@ -611,8 +611,8 @@ This function returns the number of paths in the word graph *wg* starting at
611611
size_t min,
612612
int_or_constant<size_t> max,
613613
paths::algorithm lgrthm) {
614-
return from_int(
615-
number_of_paths(wg, source, min, to_int<size_t>(max), lgrthm));
614+
return from_int(v4::paths::number_of_paths(
615+
wg, source, min, to_int<size_t>(max), lgrthm));
616616
},
617617
py::arg("wg"),
618618
py::arg("source"),
@@ -684,7 +684,8 @@ length in a given range.
684684
size_t min,
685685
int_or_constant<size_t> max,
686686
paths::algorithm algrthm) {
687-
return number_of_paths(wg, source, target, min, to_int<size_t>(max));
687+
return v4::paths::number_of_paths(
688+
wg, source, target, min, to_int<size_t>(max));
688689
},
689690
py::arg("wg"),
690691
py::arg("source"),

tests/test_paths.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,22 +140,22 @@ def test_paths_number_of_paths():
140140
assert paths.number_of_paths_algorithm(wg, 0) == paths.algorithm.acyclic
141141
assert paths.number_of_paths(wg, 0) == POSITIVE_INFINITY
142142
# source, min, max
143-
assert paths.number_of_paths(wg, 0, 0, 10) == 1023
143+
assert paths.number_of_paths(wg, 0, 0, 9) == 1023
144144
# source, target, min, max
145-
assert paths.number_of_paths(wg, 0, 1, 0, 10) == 511
145+
assert paths.number_of_paths(wg, 0, 1, 0, 9) == 511
146146

147147
assert paths.number_of_paths_algorithm(wg, 1) == paths.algorithm.acyclic
148148
assert paths.number_of_paths(wg, 1) == POSITIVE_INFINITY
149149
# source, min, max
150-
assert paths.number_of_paths(wg, 1, 0, 10) == 1023
150+
assert paths.number_of_paths(wg, 1, 0, 9) == 1023
151151
assert paths.number_of_paths(wg, 1, 0, POSITIVE_INFINITY) == POSITIVE_INFINITY
152152

153153
assert paths.number_of_paths_algorithm(wg, 2) == paths.algorithm.acyclic
154-
assert paths.number_of_paths_algorithm(wg, 2, 0, 10) == paths.algorithm.dfs
154+
assert paths.number_of_paths_algorithm(wg, 2, 0, 9) == paths.algorithm.dfs
155155
assert paths.number_of_paths_algorithm(wg, 2, 0, POSITIVE_INFINITY) == paths.algorithm.trivial
156156
assert paths.number_of_paths(wg, 2) == POSITIVE_INFINITY
157157
# source, min, max
158-
assert paths.number_of_paths(wg, 2, 0, 10) == 10
158+
assert paths.number_of_paths(wg, 2, 0, 9) == 10
159159
assert (
160-
paths.number_of_paths_algorithm(wg, 2, 2, 10, POSITIVE_INFINITY) == paths.algorithm.trivial
160+
paths.number_of_paths_algorithm(wg, 2, 2, 9, POSITIVE_INFINITY) == paths.algorithm.trivial
161161
)

0 commit comments

Comments
 (0)