Skip to content

Commit

Permalink
Various improvements
Browse files Browse the repository at this point in the history
Remove `_find` & `_union`.
Remove `DisjointSet_of_integers` `_d` attribute from `DisjointSet_of_hashables` (and adjust code).
Add notes recommending `OP_find` and `OP_union` if no input checking needed.
Touch-up docstrings.
  • Loading branch information
gmou3 committed Apr 23, 2024
1 parent 245fcb1 commit 06fa3aa
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 129 deletions.
3 changes: 0 additions & 3 deletions src/sage/sets/disjoint_set.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,13 @@ cdef class DisjointSet_class(SageObject):
cdef class DisjointSet_of_integers(DisjointSet_class):
cpdef int find(self, int i)
cpdef void union(self, int i, int j)
cdef inline int _find(self, int i)
cdef inline void _union(self, int i, int j)
cpdef root_to_elements_dict(self)
cpdef element_to_root_dict(self)
cpdef to_digraph(self)

cdef class DisjointSet_of_hashables(DisjointSet_class):
cdef list _int_to_el
cdef dict _el_to_int
cdef DisjointSet_of_integers _d
cpdef find(self, e)
cpdef void union(self, e, f)
cpdef root_to_elements_dict(self)
Expand Down
Loading

0 comments on commit 06fa3aa

Please sign in to comment.