Skip to content

Commit

Permalink
Change 'order' to 'ordering' and update circuits_matroids.pxd
Browse files Browse the repository at this point in the history
Use 'ordering' for consistency with matroid.p*
  • Loading branch information
gmou3 committed Feb 6, 2024
1 parent 3dd366a commit 6a94710
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/sage/matroids/circuits_matroid.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ cdef class CircuitsMatroid(Matroid):
cpdef bases(self) noexcept
cpdef circuits(self, k=*) noexcept
cpdef nonspanning_circuits(self) noexcept
cpdef no_broken_circuits_sets(self, ordering=*) noexcept

# properties
cpdef girth(self) noexcept
Expand Down
12 changes: 6 additions & 6 deletions src/sage/matroids/circuits_matroid.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ cdef class CircuitsMatroid(Matroid):
NSC.append(C)
return NSC

cpdef no_broken_circuits_sets(self, order=None) noexcept:
cpdef no_broken_circuits_sets(self, ordering=None) noexcept:
r"""
Return the no broken circuits (NBC) sets of ``self``.
Expand All @@ -494,7 +494,7 @@ cdef class CircuitsMatroid(Matroid):
INPUT:
- ``order`` -- a total ordering of the groundset given as a list
- ``ordering`` -- a total ordering of the groundset given as a list
OUTPUT: a list of frozensets
Expand Down Expand Up @@ -525,16 +525,16 @@ cdef class CircuitsMatroid(Matroid):
sage: C1 == C2
True
"""
if order is None:
order = sorted(self.groundset(), key=str)
if ordering is None:
ordering = sorted(self.groundset(), key=str)
else:
if frozenset(order) != self.groundset():
if frozenset(ordering) != self.groundset():
raise ValueError("not an ordering of the groundset")

# compute broken circuits
cdef list BC = []
for C in self._C:
for e in order:
for e in ordering:
if e in C:
BC.append(C - set([e]))
break
Expand Down

0 comments on commit 6a94710

Please sign in to comment.