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

Commit

Permalink
src/sage/geometry/polyhedron/parent.py: For backend='normaliz', accep…
Browse files Browse the repository at this point in the history
…t subrings of SR
  • Loading branch information
Matthias Koeppe committed Nov 1, 2021
1 parent f98855b commit 7f1500e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/sage/geometry/polyhedron/parent.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from sage.modules.free_module import FreeModule, is_FreeModule
from sage.misc.cachefunc import cached_method, cached_function
from sage.misc.lazy_import import lazy_import
import sage.rings.abc
from sage.rings.integer_ring import ZZ
from sage.rings.rational_field import QQ
from sage.rings.real_double import RDF
Expand Down Expand Up @@ -113,6 +114,13 @@ def Polyhedra(ambient_space_or_base_ring=None, ambient_dim=None, backend=None, *
...
ValueError: the 'polymake' backend for polyhedron cannot be used with Algebraic Real Field
sage: Polyhedra(QQ, 2, backend='normaliz') # optional - pynormaliz
Polyhedra in QQ^2
sage: Polyhedra(SR, 2, backend='normaliz') # optional - pynormaliz # optional - sage.symbolic
Polyhedra in (Symbolic Ring)^2
sage: SCR = SR.subring(no_variables=True) # optional - sage.symbolic
sage: Polyhedra(SCR, 2, backend='normaliz') # optional - pynormaliz # optional - sage.symbolic
Polyhedra in (Symbolic Constants Subring)^2
"""
if ambient_space_or_base_ring is not None:
if ambient_space_or_base_ring in Rings():
Expand Down Expand Up @@ -161,7 +169,7 @@ def Polyhedra(ambient_space_or_base_ring=None, ambient_dim=None, backend=None, *
return Polyhedra_QQ_normaliz(base_ring, ambient_dim, backend)
elif backend == 'normaliz' and base_ring is ZZ:
return Polyhedra_ZZ_normaliz(base_ring, ambient_dim, backend)
elif backend == 'normaliz' and (base_ring is SR or base_ring.is_exact()):
elif backend == 'normaliz' and (isinstance(base_ring, sage.rings.abc.SymbolicRing) or base_ring.is_exact()):
return Polyhedra_normaliz(base_ring, ambient_dim, backend)
elif backend == 'cdd' and base_ring in (ZZ, QQ):
return Polyhedra_QQ_cdd(QQ, ambient_dim, backend)
Expand Down

0 comments on commit 7f1500e

Please sign in to comment.