The PPL (Parma Polyhedra Library) backend for polyhedral computations#
- class sage.geometry.polyhedron.backend_ppl.Polyhedron_QQ_ppl(parent, Vrep, Hrep, ppl_polyhedron=None, mutable=False, **kwds)#
Bases:
Polyhedron_ppl
,Polyhedron_QQ
Polyhedra over \(\QQ\) with ppl
INPUT:
Vrep
– a list[vertices, rays, lines]
orNone
.Hrep
– a list[ieqs, eqns]
orNone
.
EXAMPLES:
sage: p = Polyhedron(vertices=[(0,0),(1,0),(0,1)], rays=[(1,1)], lines=[], ....: backend='ppl', base_ring=QQ) sage: TestSuite(p).run()
- class sage.geometry.polyhedron.backend_ppl.Polyhedron_ZZ_ppl(parent, Vrep, Hrep, ppl_polyhedron=None, mutable=False, **kwds)#
Bases:
Polyhedron_ppl
,Polyhedron_ZZ
Polyhedra over \(\ZZ\) with ppl
INPUT:
Vrep
– a list[vertices, rays, lines]
orNone
.Hrep
– a list[ieqs, eqns]
orNone
.
EXAMPLES:
sage: p = Polyhedron(vertices=[(0,0),(1,0),(0,1)], rays=[(1,1)], lines=[], ....: backend='ppl', base_ring=ZZ) sage: TestSuite(p).run()
- class sage.geometry.polyhedron.backend_ppl.Polyhedron_ppl(parent, Vrep, Hrep, ppl_polyhedron=None, mutable=False, **kwds)#
Bases:
Polyhedron_mutable
Polyhedra with ppl
INPUT:
Vrep
– a list[vertices, rays, lines]
orNone
.Hrep
– a list[ieqs, eqns]
orNone
.
EXAMPLES:
sage: p = Polyhedron(vertices=[(0,0),(1,0),(0,1)], rays=[(1,1)], lines=[], backend='ppl') sage: TestSuite(p).run()
- Hrepresentation(index=None)#
Return the objects of the H-representation. Each entry is either an inequality or a equation.
INPUT:
index
– either an integer orNone
OUTPUT:
The optional argument is an index running from
0
toself.n_Hrepresentation()-1
. If present, the H-representation object at the given index will be returned. Without an argument, returns the list of all H-representation objects.EXAMPLES:
sage: p = polytopes.hypercube(3) sage: p.Hrepresentation(0) An inequality (-1, 0, 0) x + 1 >= 0 sage: p.Hrepresentation(0) == p.Hrepresentation()[0] True
sage: P = p.parent() sage: p = P._element_constructor_(p, mutable=True) sage: p.Hrepresentation(0) An inequality (0, 0, -1) x + 1 >= 0 sage: p._clear_cache() sage: p.Hrepresentation(0) An inequality (0, 0, -1) x + 1 >= 0 sage: TestSuite(p).run()
- Vrepresentation(index=None)#
Return the objects of the V-representation. Each entry is either a vertex, a ray, or a line.
See
sage.geometry.polyhedron.constructor
for a definition of vertex/ray/line.INPUT:
index
– either an integer orNone
OUTPUT:
The optional argument is an index running from
0
toself.n_Vrepresentation()-1
. If present, the V-representation object at the given index will be returned. Without an argument, returns the list of all V-representation objects.EXAMPLES:
sage: p = polytopes.cube() sage: p.Vrepresentation(0) A vertex at (1, -1, -1)
sage: P = p.parent() sage: p = P._element_constructor_(p, mutable=True) sage: p.Vrepresentation(0) A vertex at (-1, -1, -1) sage: p._clear_cache() sage: p.Vrepresentation(0) A vertex at (-1, -1, -1) sage: TestSuite(p).run()
- set_immutable()#
Make this polyhedron immutable. This operation cannot be undone.
EXAMPLES:
sage: p = Polyhedron([[1, 1]], mutable=True) sage: p.is_mutable() True sage: hasattr(p, "_Vrepresentation") False sage: p.set_immutable() sage: hasattr(p, "_Vrepresentation") True