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

Commit

Permalink
improved error message for polar of non-fulldimensional polytopes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Kliem committed Jan 24, 2020
1 parent dde78cb commit 47a846e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sage/geometry/polyhedron/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5883,12 +5883,12 @@ def polar(self, in_affine_span=False):
sage: P.polar()
Traceback (most recent call last):
...
ValueError: must be full-dimensional
ValueError: not full-dimensional; try with 'in_affine_span=True'
"""
if not self.is_compact():
raise ValueError("not a polytope")
if not in_affine_span and not self.dim() == self.ambient_dim():
raise ValueError("must be full-dimensional")
raise ValueError("not full-dimensional; try with 'in_affine_span=True'")

verts = [list(self.center() - v.vector()) for v in self.vertex_generator()]
parent = self.parent().base_extend(self.center().parent())
Expand Down Expand Up @@ -7361,8 +7361,8 @@ def integral_points(self, threshold=100000):
A case where rounding in the right direction goes a long way::
sage: P = 1/10*polytopes.hypercube(14)
sage: P.integral_points()
sage: P = 1/10*polytopes.hypercube(14) # long time
sage: P.integral_points() # long time
((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),)
Finally, the 3-d reflexive polytope number 4078::
Expand Down

0 comments on commit 47a846e

Please sign in to comment.