Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/knuth-bendix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ construct *kb*. This function triggers a full enumeration of *kb*.
>>> kb = KnuthBendix(congruence_kind.twosided, p)
>>> kb.number_of_classes()
+∞
>>> list(knuth_bendix.normal_forms(kb).min(1).max(3))
>>> list(knuth_bendix.normal_forms(kb).min(1).max(2))
['a', 'b', 'c', 'aa', 'ab', 'ac', 'ba', 'bb', 'bc', 'ca', 'cb', 'cc']
)pbdoc");

Expand Down
3 changes: 2 additions & 1 deletion src/paths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,8 @@ length in a given range.
size_t min,
int_or_constant<size_t> max,
paths::algorithm algrthm) {
return number_of_paths(wg, source, target, min, to_int<size_t>(max));
return number_of_paths(
wg, source, target, min, to_int<size_t>(max), algrthm);
},
py::arg("wg"),
py::arg("source"),
Expand Down
12 changes: 6 additions & 6 deletions tests/test_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,22 +140,22 @@ def test_paths_number_of_paths():
assert paths.number_of_paths_algorithm(wg, 0) == paths.algorithm.acyclic
assert paths.number_of_paths(wg, 0) == POSITIVE_INFINITY
# source, min, max
assert paths.number_of_paths(wg, 0, 0, 10) == 1023
assert paths.number_of_paths(wg, 0, 0, 9) == 1023
# source, target, min, max
assert paths.number_of_paths(wg, 0, 1, 0, 10) == 511
assert paths.number_of_paths(wg, 0, 1, 0, 9) == 511

assert paths.number_of_paths_algorithm(wg, 1) == paths.algorithm.acyclic
assert paths.number_of_paths(wg, 1) == POSITIVE_INFINITY
# source, min, max
assert paths.number_of_paths(wg, 1, 0, 10) == 1023
assert paths.number_of_paths(wg, 1, 0, 9) == 1023
assert paths.number_of_paths(wg, 1, 0, POSITIVE_INFINITY) == POSITIVE_INFINITY

assert paths.number_of_paths_algorithm(wg, 2) == paths.algorithm.acyclic
assert paths.number_of_paths_algorithm(wg, 2, 0, 10) == paths.algorithm.dfs
assert paths.number_of_paths_algorithm(wg, 2, 0, 9) == paths.algorithm.dfs
assert paths.number_of_paths_algorithm(wg, 2, 0, POSITIVE_INFINITY) == paths.algorithm.trivial
assert paths.number_of_paths(wg, 2) == POSITIVE_INFINITY
# source, min, max
assert paths.number_of_paths(wg, 2, 0, 10) == 10
assert paths.number_of_paths(wg, 2, 0, 9) == 10
assert (
paths.number_of_paths_algorithm(wg, 2, 2, 10, POSITIVE_INFINITY) == paths.algorithm.trivial
paths.number_of_paths_algorithm(wg, 2, 2, 9, POSITIVE_INFINITY) == paths.algorithm.trivial
)