-
-
Notifications
You must be signed in to change notification settings - Fork 491
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #32013: Initialize a Set from a ConvexSet_base instance
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 }}} URL: https://trac.sagemath.org/32013 Reported by: mkoeppe Ticket author(s): Matthias Koeppe Reviewer(s): Travis Scrimshaw
- Loading branch information
Showing
6 changed files
with
459 additions
and
232 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
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
Oops, something went wrong.