Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to extract a list from the result of Hrepresentation?

In SageMath, I use the following command to compute Hrepresentations.

P1 = Polyhedron(vertices = [[3, 1, 5, 3], [3, 1, 4, 4], [3, 1, 3, 5], [2, 2, 5, 3], [2, 2, 4, 4], [2, 2, 3, 5], [1, 3, 4, 4], [1, 3, 3, 5]])
r1=P1.Hrepresentation()
r1

The result I got is

(An equation (0, 0, 1, 1) x - 8 == 0,
 An equation (1, 1, 0, 0) x - 4 == 0,
 An inequality (-1, 0, 0, 0) x + 3 >= 0,
 An inequality (1, 0, 0, 1) x - 5 >= 0,
 An inequality (1, 0, 0, 0) x - 1 >= 0,
 An inequality (0, 0, 0, -1) x + 5 >= 0,
 An inequality (0, 0, 0, 1) x - 3 >= 0)

How to get the list

[ [0,0,1,1], [1,1,0,0], [-1,0,0,0], [1,0,0,1], [1,0,0,0], [0,0,0,-1] ]

from r1? Thank you very much.