Skip to content

Commit 4672bf0

Browse files
author
Release Manager
committed
gh-41150: `Matroid._max_independent`: Fix call of `_rank` Bug reported in passagemath/passagemath#1783. URL: #41150 Reported by: gmou3 Reviewer(s):
2 parents c92c540 + 0221d15 commit 4672bf0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/sage/matroids/matroid.pyx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,12 +637,19 @@ cdef class Matroid(SageObject):
637637
True
638638
sage: all(M.is_dependent(X.union([y])) for y in M.groundset() if y not in X)
639639
True
640+
641+
TESTS::
642+
643+
sage: M = matroids.catalog.R10()
644+
sage: M1M = M.direct_sum(M)
645+
sage: Matroid(M1M, regular=True) # indirect doctest
646+
Regular matroid of rank 10 on 20 elements with 26244 bases
640647
"""
641648
cdef list res = []
642649
cdef int r = 0
643650
for e in X:
644651
res.append(e)
645-
if self._rank(res) > r:
652+
if self._rank(frozenset(res)) > r:
646653
r += 1
647654
else:
648655
res.pop()

0 commit comments

Comments
 (0)