Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
ManifoldSubset.open_superset_family: New
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Apr 25, 2021
1 parent afe10a0 commit cd1fa4d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/sage/manifolds/subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,11 @@ def open_supersets(self):
r"""
Generate the open supersets of ``self``.
.. NOTE::
To get the open supersets as a family, sorted by name, use the method
:meth:`open_superset_family` instead.
EXAMPLES::
sage: M = Manifold(2, 'M', structure='topological')
Expand All @@ -590,6 +595,35 @@ def open_supersets(self):
if superset.is_open():
yield superset

def open_superset_family(self):
r"""
Return the family of open supersets of ``self``.
The family is sorted by the alphabetical names of the subsets.
OUTPUT:
- a :class:`ManifoldSubsetFiniteFamily` instance containing all the
open supersets that have been defined on the current subset
.. NOTE::
If you only need to iterate over the open supersets in arbitrary
order, you can use the generator method :meth:`open_supersets`
instead.
EXAMPLES::
sage: M = Manifold(2, 'M', structure='topological')
sage: U = M.open_subset('U')
sage: V = U.subset('V')
sage: W = V.subset('W')
sage: W.open_superset_family()
Set {M, U} of open subsets of the 2-dimensional topological manifold M
"""
return ManifoldSubsetFiniteFamily(self.open_supersets())

def subsets(self):
r"""
Generate the subsets that have been defined on the current subset.
Expand Down

0 comments on commit cd1fa4d

Please sign in to comment.