Skip to content

Commit

Permalink
Trac #19803: difference of behavior in polyhedra with different backends
Browse files Browse the repository at this point in the history
The following error used to occur:

{{{
sage: from sage.geometry.polyhedron.parent import Polyhedra
sage: P_ppl = Polyhedra(ZZ, 3, 'ppl')
sage: P_cdd = Polyhedra(ZZ, 3, 'cdd')
sage: P_ppl([[],[],[]], None)
The empty polyhedron in ZZ^3
sage: P_cdd([[],[],[]], None)
Traceback (most recent call last):
...
TypeError: can't multiply sequence by non-int of type 'NoneType'
}}}

Apparently it got fixed along the way and we add doctests verifying it.

URL: https://trac.sagemath.org/19803
Reported by: vdelecroix
Ticket author(s): Jonathan Kliem
Reviewer(s): Laith Rastanawi
  • Loading branch information
Release Manager committed Jan 10, 2020
2 parents b8f53f7 + 96dad18 commit af2f949
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/sage/geometry/polyhedron/backend_cdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,17 @@ class Polyhedron_QQ_cdd(Polyhedron_cdd, Polyhedron_QQ):
sage: from sage.geometry.polyhedron.backend_cdd import Polyhedron_QQ_cdd
sage: Polyhedron_QQ_cdd(parent, [ [(1,0),(0,1),(0,0)], [], []], None, verbose=False)
A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 3 vertices
TESTS:
Check that :trac:`19803` is fixed::
sage: from sage.geometry.polyhedron.parent import Polyhedra
sage: P_cdd = Polyhedra(QQ, 3, 'cdd')
sage: P_cdd([[],[],[]], None)
The empty polyhedron in QQ^3
sage: Polyhedron(vertices=[], backend='cdd', base_ring=QQ)
The empty polyhedron in QQ^0
"""

_cdd_type = 'rational'
Expand Down Expand Up @@ -439,6 +450,15 @@ class Polyhedron_RDF_cdd(Polyhedron_cdd, Polyhedron_RDF):
10
sage: P.n_facets()
10
Check that :trac:`19803` is fixed::
sage: from sage.geometry.polyhedron.parent import Polyhedra
sage: P_cdd = Polyhedra(RDF, 3, 'cdd')
sage: P_cdd([[],[],[]], None)
The empty polyhedron in RDF^3
sage: Polyhedron(vertices=[], backend='cdd', base_ring=RDF)
The empty polyhedron in RDF^0
"""
_cdd_type = 'real'

Expand Down

0 comments on commit af2f949

Please sign in to comment.