Skip to content

Commit

Permalink
Use new FlatsMatroid for matroid coming from covectors
Browse files Browse the repository at this point in the history
  • Loading branch information
thecaligarmo committed Sep 8, 2024
1 parent f0face7 commit 910f4d4
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,9 @@ def matroid(self):
....: [0,0,0]]
sage: M = OrientedMatroid(C, key='covector')
sage: M.matroid()
Matroid of rank 2 on 3 elements
Matroid of rank 2 on 3 elements with 5 flats
"""
from sage.matroids.constructor import Matroid
from sage.combinat.posets.posets import Poset
from sage.matroids.flats_matroid import FlatsMatroid
flats = list(set([frozenset(X.zeros()) for X in self.elements()]))
rf = Poset((flats, lambda a, b: a.issubset(b))).rank_function()
return Matroid(groundset=self.groundset(), rank_function=rf)
return FlatsMatroid(groundset=self.groundset(), flats=flats)

0 comments on commit 910f4d4

Please sign in to comment.