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

Commit

Permalink
took care of non-compact case
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Kliem committed Dec 26, 2019
1 parent 4046e3a commit 485cc64
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/sage/geometry/polyhedron/backend_normaliz.py
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,10 @@ def _volume_normaliz(self, measure='euclidean'):
sage: P = polytopes.dodecahedron(backend='normaliz')
sage: P._volume_normaliz('ambient') == P.volume(engine='internal') # optional - pynormaliz
True
sage: P = Polyhedron(rays=[[1]], backend='normaliz') # optional - pynormaliz
sage: P.volume() # optional - pynormaliz
+Infinity
"""
cone = self._normaliz_cone
assert cone
Expand All @@ -1297,6 +1301,9 @@ def _volume_normaliz(self, measure='euclidean'):
elif measure == 'ambient':
if self.dim() < self.ambient_dim():
return self.base_ring().zero()
if not self.is_compact():
from sage.rings.infinity import infinity
return infinity

from sage.functions.other import factorial
volume = self._volume_normaliz('induced_lattice')/factorial(self.dim())
Expand Down

0 comments on commit 485cc64

Please sign in to comment.