Ask Your Question

Revision history [back]

If you look at r1, you see that it is a tuple:

sage: type(r1)
<class 'tuple'>

Now, if you look at the first element of r1, you see it is an equation:

sage: type(r1[0])
<class 'sage.geometry.polyhedron.representation.Equation'>

You can try to extract its coefficients by making it a list:

sage: list(r1[0])
[-8, 0, 0, 1, 1]

You see that the constant term is the first, which you can remove as follows:

sage: list(r1[0])[1:]
[0, 0, 1, 1]

You can put all those remarks together to do:

sage: [list(eq)[1:] for eq in r1] [[0, 0, 1, 1], [1, 1, 0, 0], [-1, 0, 0, 0], [1, 0, 0, 1], [1, 0, 0, 0], [0, 0, 0, -1], [0, 0, 0, 1]]

If you look at r1, you see that it is a tuple:

sage: type(r1)
<class 'tuple'>

Now, if you look at the first element of r1, you see it is an equation:

sage: type(r1[0])
<class 'sage.geometry.polyhedron.representation.Equation'>

You can try to extract its coefficients by making it a list:

sage: list(r1[0])
[-8, 0, 0, 1, 1]

You see that the constant term is the first, which you can remove as follows:

sage: list(r1[0])[1:]
[0, 0, 1, 1]

You can put all those remarks together to do:

sage: [list(eq)[1:] for eq in r1]
[[0, 0, 1, 1],
 [1, 1, 0, 0],
 [-1, 0, 0, 0],
 [1, 0, 0, 1],
 [1, 0, 0, 0],
 [0, 0, 0, -1],
 [0, 0, 0, 1]]

1]]