Changes between Initial Version and Version 2 of Ticket #32013


Ignore:
Timestamp:
06/20/21 19:50:49 (5 months ago)
Author:
mkoeppe
Comment:

Last 10 new commits:

f02ca28src/sage/geometry/polyhedron/face.py: Remove unused import
1744ffaMerge #31959
bd8e702Merge #31990
f351eb8src/sage/sets/set.py: Split out mix-in classes Set_base, Set_boolean_operators, Set_add_sub_operators from Set_object; pycodestyle fixes
f1db666Polyhedron_base.*contains: Return False for non-iterables - do not raise an exception
6237fbcConvexSet_base.is_finite, cardinality: New
18270ceSet_object._an_element_: Handle non-iterable objects by delegating to __object.an_element
b8f5978Set: Create a wrapper instance also for Elements that subclass Set_base
b67092cSet_base.union, intersection, difference, symmetric_difference: Convert to Set if necessary
e144389ConvexSet_base.intersection: Remove abstract method; now inherits Set_base.intersection

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32013

    • Property Status changed from new to needs_review
    • Property Authors changed from to Matthias Koeppe
    • Property Cc gh-kliem tscrim added
    • Property Dependencies changed from to #31990
    • Property Branch changed from to u/mkoeppe/initialize_a_set_from_a_convexset_base_instance
    • Property Commit changed from to e1443896851ac805a89e8747e8c7412bbc7d9d10
  • Ticket #32013 – Description

    initial v2  
     1A `Polyhedron` is not a `Parent`, so `Set` refuses to construct the set of its elements.
     2
     3We change this by creating a new abstract base class for non-necessarily-parent sets with methods `union`, `intersection`, etc.
     4
     5`ConvexSet_base` (from #31919) now inherits from `Set_base`.
     6
     7So we can now do the following things:
     8{{{
     9sage: Set(polytopes.cube())                                                                                                                                                                         
     10Set of elements of A 3-dimensional polyhedron in ZZ^3 defined as the convex hull of 8 vertices
     11sage: polytopes.cube().union(polytopes.tetrahedron())                                                                                                                                               
     12Set-theoretic union of Set of elements of A 3-dimensional polyhedron in ZZ^3 defined as the convex hull of 8 vertices and Set of elements of A 3-dimensional polyhedron in ZZ^3 defined as the convex hull of 4 vertices
     13}}}