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

Commit

Permalink
Polyhedron_normaliz._init_from_normaliz_data: Add doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Sep 16, 2018
1 parent 1e20ef2 commit f3d11a3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/sage/geometry/polyhedron/backend_normaliz.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,18 @@ def _init_from_normaliz_cone(self, normaliz_cone):
self._init_Hrepresentation_from_normaliz()

def _init_from_normaliz_data(self, data, verbose=False):
"""
Construct polyhedron from normaliz ``data`` (a dictionary).
TESTS::
sage: p = Polyhedron(backend='normaliz', ambient_dim=2) # optional - pynormaliz
sage: from sage.geometry.polyhedron.backend_normaliz import Polyhedron_normaliz # optional - pynormaliz
sage: data = {'inhom_inequalities': [[-1L, 2L, 0L], [0L, 0L, 1L], [2L, -1L, 0L]]} # optional - pynormaliz
sage: Polyhedron_normaliz._init_from_normaliz_data(p, data) # optional - pynormaliz
sage: p.inequalities_list() # optional - pynormaliz
[[0, -1, 2], [0, 2, -1]]
"""
import PyNormaliz
if verbose:
print("# Calling PyNormaliz.NmzCone(**{})".format(data))
Expand Down Expand Up @@ -410,7 +422,7 @@ def _make_normaliz_cone(data, verbose=False):
TESTS::
sage: from sage.geometry.polyhedron.backend_normaliz import Polyhedron_normaliz # optional - pynormaliz
sage: data = {'inhom_inequalities': [[-1L, 2L, 0L], [0L, 0L, 1L], [2L, -1L, 0L]],} # optional - pynormaliz
sage: data = {'inhom_inequalities': [[-1L, 2L, 0L], [0L, 0L, 1L], [2L, -1L, 0L]]} # optional - pynormaliz
sage: nmz_cone = Polyhedron_normaliz._make_normaliz_cone(data,verbose=False) # optional - pynormaliz
sage: from PyNormaliz import NmzResult # optional - pynormaliz
sage: NmzResult(nmz_cone, "ExtremeRays") # optional - pynormaliz
Expand Down

0 comments on commit f3d11a3

Please sign in to comment.