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

Commit

Permalink
Added infinite volume
Browse files Browse the repository at this point in the history
  • Loading branch information
jplab committed Mar 10, 2017
1 parent fd5f71a commit 0429a92
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/sage/geometry/polyhedron/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3955,7 +3955,17 @@ def volume(self, engine='auto', **kwds):
0
sage: I.volume(engine='lrs') #optional - lrslib
1.0
The volume of an unbounded polyhedron is infinity::
sage: P = Polyhedron(vertices = [[1, 0], [0, 1]], rays = [[1, 1]])
sage: P.volume()
+Infinity
"""
if not self.is_compact():
from sage.rings.infinity import infinity
return infinity

if engine == 'lrs':
return self._volume_lrs(**kwds)
dim = self.dim()
Expand Down

0 comments on commit 0429a92

Please sign in to comment.