forked from sagemath/sage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sagemathgh-37340: Add class FlatsMatroid
This matroid subclass allows the definition and internal representation of a matroid based on its flats (closed sets). This representation can be advantageous for some algorithms. This completes the list of the most standard matroid definitions (bases, circuits, flats, rank function). This PR is similar to sagemath#37148. - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation accordingly. URL: sagemath#37340 Reported by: gmou3 Reviewer(s): gmou3, Matthias Köppe
- Loading branch information
Showing
6 changed files
with
585 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from sage.matroids.matroid cimport Matroid | ||
|
||
cdef class FlatsMatroid(Matroid): | ||
cdef frozenset _groundset # _E | ||
cdef int _matroid_rank # _R | ||
cdef dict _F # flats | ||
cpdef groundset(self) | ||
cpdef _rank(self, X) | ||
cpdef full_rank(self) | ||
cpdef _is_independent(self, F) | ||
|
||
# enumeration | ||
cpdef flats(self, k) | ||
cpdef whitney_numbers2(self) | ||
|
||
# isomorphism | ||
cpdef _is_isomorphic(self, other, certificate=*) | ||
|
||
# verification | ||
cpdef is_valid(self) |
Oops, something went wrong.