Closed mkoeppe closed 3 years ago
Branch: u/mkoeppe/abc_for_convex_sets
Branch pushed to git repo; I updated commit sha1. New commits:
e67f753 | ConvexRationalPolyhedralCone: Add method is_empty and aliases is_full_dimensional, is_universe |
770fdcd | LatticePolytopeClass, IntegralRayCollection: Make ambient_dim an alias for lattice_dim |
b2ac639 | ConvexSet_base.dim: New |
ccc8421 | ConvexSet_base.is_compact, ConvexSet_compact: New |
Commit: ccc8421
Author: Matthias Koeppe
Dependencies: #31916
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
9df2104 | sage.geometry.relative_interior: Move here from sage.geometry.polyhedron.relint |
b8bfe20 | ConvexRationalPolyhedralCone: Add methods interior, relative_interior |
6869673 | relative_interior: Fix for dimension 0 |
021d073 | RelativeInterior: Add documentation, tests, comparison methods, method relative_interior |
8f38e04 | ConvexRationalPolyhedralCone.interior, relative_interior: Add doctests |
5f9c852 | RelativeInterior.interior: New |
5c089ec | RelativeInterior.__eq__, __ne__: Handle comparisons with objects of other types |
86ce301 | Polyhedron_base.is_relatively_open: New; fix relative_interior for affine subspaces |
42adced | Merge #31916 |
4bac2fe | RelativeInterior: Subclass ConvexSet_relatively_open, add missing methods |
Description changed:
---
+++
@@ -2,4 +2,4 @@
We use it to test/unify the API of `Polyhedron`, `ConvexRationalPolyhedralCone`, `LatticePolytope`, `RelativeInterior` (#31916)
-
+See also: #31926 Connect Sage sets to sympy sets
Branch pushed to git repo; I updated commit sha1. New commits:
dede9de | src/doc/en/reference/discrete_geometry/index.rst: Add sage/geometry/convex_set |
Missing doctest.
+ def is_empty(self):
+ """
+ Return whether ``self`` is the empty set.
+
+ Because a cone always contains the origin, this method returns ``False``.
+ """
+ return False
Branch pushed to git repo; I updated commit sha1. New commits:
007e6fd | ConvexRationalPolyhedralCone.is_empty: Add doctest |
I guess it is back on needs review.
Can you please add doctests for src/sage/geometry/convex_set.py
yet.
Branch pushed to git repo; I updated commit sha1. New commits:
73e39ce | ConvexRationalPolyhedralCone.is_compact: Define |
92f0610 | ConvexSet_open: New |
03a31ef | Polyhedron_base.is_full_dimensional: Merge into ConvexSet_base.is_full_dimensional |
a71507e | ConvexSet_base: Add some doctests |
3a83182 | ConvexSet_base.relative_interior: New |
6a0baac | ConvexSet_base._test_convex_set: New |
Branch pushed to git repo; I updated commit sha1. New commits:
e2b0ef7 | ConvexSet_base._test_convex_set: Fix doctest output |
Description changed:
---
+++
@@ -2,4 +2,7 @@
We use it to test/unify the API of `Polyhedron`, `ConvexRationalPolyhedralCone`, `LatticePolytope`, `RelativeInterior` (#31916)
-See also: #31926 Connect Sage sets to sympy sets
+See also:
+- #31926 Connect Sage sets to sympy sets
+- #31955 ABC for convex sets (follow up)
+
Description changed:
---
+++
@@ -4,5 +4,6 @@
See also:
- #31926 Connect Sage sets to sympy sets
+- #31947 `ConvexSet.contains`: Handle symbolic argument
- #31955 ABC for convex sets (follow up)
Description changed:
---
+++
@@ -3,6 +3,7 @@
We use it to test/unify the API of `Polyhedron`, `ConvexRationalPolyhedralCone`, `LatticePolytope`, `RelativeInterior` (#31916)
See also:
+- #31959 `PolyhedronFace`: Make it a subclass of `ConvexSet_closed`
- #31926 Connect Sage sets to sympy sets
- #31947 `ConvexSet.contains`: Handle symbolic argument
- #31955 ABC for convex sets (follow up)
Changed branch from u/mkoeppe/abc_for_convex_sets to u/gh-kliem/abc_for_convex_sets
ambient_dimension
should return the dimension of self
.+ def ambient_dimension(self):
+ Return the dimension of ``self``.
+
+ This is the same as :meth:`ambient_dim`.
codim
is an alias of codimension
should be doctested I think. - sage: P = Polyhedron()
+ sage: P = Polyhedron([[1, 2], [3, 4]])
sage: from sage.geometry.relative_interior import RelativeInterior
sage: TestSuite(RelativeInterior(P)).run()
Would it make sense to run the test suite on relative interior of polyhedra as part of the standard polyhedron test suite? Just like in #31821.
Reviewer: Jonathan Kliem
Thanks for these fixes and suggestions!
Replying to @kliem:
- Why have you removed the test suite on the relative interior of the empty polyhedron?
The reason for this is the assumption in is_closed
Changed branch from u/gh-kliem/abc_for_convex_sets to u/mkoeppe/abc_for_convex_sets
Replying to @mkoeppe:
Replying to @kliem:
- Why have you removed the test suite on the relative interior of the empty polyhedron?
The reason for this is the assumption in
is_closed
I see. I think it should be fixed then. Either we drop the requirement of being identical in the test suite or we add another clause for Polyhedron_base.relative_interior
:
if not self.is_full_dimensional():
+ if self.is_empty():
+ return self
return self.parent().element_class(self.parent(), None, None)
return self.relative_interior()
New commits:
142fb46 | ConvexSet_base.codimension: Add doctest for alias 'codim' |
30ebaf5 | ConvexSet_base.ambient_dim, ambient_dimension: Fix doc |
Replying to @kliem:
New commits:
c75ba42
fix coverage
Please fix coverage or cherry-pick the above commit.
It's trivial, I see no need to add me as an author. Of course this case is trivial. But if we allow people to not test trivial things, where do we draw the line?
This is one reason why I improved sage --fixdoctests
to work for error messages as well.
Sorry, forgot to pull in your changes
Branch pushed to git repo; I updated commit sha1. New commits:
fcf2a32 | fix coverage |
Branch pushed to git repo; I updated commit sha1. New commits:
8ff6457 | Polyhedron_base.interior: Handle the empty polyhedron correctly |
Replying to @kliem:
Replying to @mkoeppe:
Replying to @kliem:
- Why have you removed the test suite on the relative interior of the empty polyhedron?
The reason for this is the assumption in
is_closed
I see. I think it should be fixed then. Either we drop the requirement of being identical in the test suite or we add another clause for
Polyhedron_base.relative_interior
:if not self.is_full_dimensional(): + if self.is_empty(): + return self return self.parent().element_class(self.parent(), None, None) return self.relative_interior()
I have made a similar fix
We create a base class
ConvexSet_base
with abstract methods to define an API for convex sets (convex subsets of a finite dimensional topological R-vector space such asR^n
).We use it to test/unify the API of
Polyhedron
,ConvexRationalPolyhedralCone
,LatticePolytope
,RelativeInterior
(#31916)See also:
31959
PolyhedronFace
: Make it a subclass ofConvexSet_closed
31990
ConvexSet_base
: Add methodsan_element
,some_elements
31926 Connect Sage sets to sympy sets
31947
ConvexSet.contains
: Handle symbolic argument31955 ABC for convex sets (follow up)
Depends on #31916
CC: @kliem @yuan-zhou @jplab @tscrim @novoselt @orlitzky
Component: geometry
Author: Matthias Koeppe
Branch/Commit:
686d0af
Reviewer: Jonathan Kliem
Issue created by migration from https://trac.sagemath.org/ticket/31919