Skip to content

Initialize a Set from a ConvexSet_base instance #32013

@mkoeppe

Description

@mkoeppe

A Polyhedron is not a Parent, so Set refuses to construct the set of its elements.

We change this by creating a new abstract base class for non-necessarily-parent sets with methods union, intersection, etc.

ConvexSet_base (from #31919) and RealSet now both inherit from Set_base. To complete the implementation of the Set_base protocol, we add an implementation of RealSet.symmetric_difference.

So we can now do the following things:

sage: Set(polytopes.cube())                                                                                                                                                                          
Set of elements of A 3-dimensional polyhedron in ZZ^3 defined as the convex hull of 8 vertices
sage: polytopes.cube().union(polytopes.tetrahedron())                                                                                                                                                
Set-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

Depends on #30473

CC: @kliem @tscrim

Component: geometry

Author: Matthias Koeppe

Branch/Commit: fff2a79

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/32013

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions