Changes between Initial Version and Version 1 of Ticket #24837
- Timestamp:
- 02/28/18 10:49:45 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #24837
-
Property
Status
changed from
new
toneeds_review
-
Property
Authors
changed from
to
Jean-Philippe Labbé
-
Property
Dependencies
changed from
to
#22572
-
Property
Branch
changed from
to
u/jipilab/24837
-
Property
Commit
changed from
to
7cf1a562e411bb1307b906c173d04f177d66fc0f
-
Property
Status
changed from
-
Ticket #24837 – Description
initial v1 2 2 3 3 {{{ 4 sage: Cube = polytopes.cube() 5 sage: TCube = Cube.truncation() 4 6 sage: Nice_repr = TCube.repr_pretty_Hrepresentation(separator='\n') 5 sage: print(Nice_repr)6 1 >= x07 1 >= x18 3*x1 + 7 >= 3*x0 + 3*x29 x0 + 1 >= 010 x1 + 1 >= 011 3*x0 + 7 >= 3*x1 + 3*x212 3*x0 + 3*x1 + 7 >= 3*x213 3*x0 + 3*x2 + 7 >= 3*x114 3*x0 + 3*x1 + 3*x2 + 7 >= 015 x2 + 1 >= 016 1 >= x217 3*x1 + 3*x2 + 7 >= 3*x018 3*x2 + 7 >= 3*x0 + 3*x119 7 >= 3*x0 + 3*x1 + 3*x27 sage: print(Nice_repr) 8 1 >= x0 9 1 >= x1 10 3*x1 + 7 >= 3*x0 + 3*x2 11 x0 + 1 >= 0 12 x1 + 1 >= 0 13 3*x0 + 7 >= 3*x1 + 3*x2 14 3*x0 + 3*x1 + 7 >= 3*x2 15 3*x0 + 3*x2 + 7 >= 3*x1 16 3*x0 + 3*x1 + 3*x2 + 7 >= 0 17 x2 + 1 >= 0 18 1 >= x2 19 3*x1 + 3*x2 + 7 >= 3*x0 20 3*x2 + 7 >= 3*x0 + 3*x1 21 7 >= 3*x0 + 3*x1 + 3*x2 20 22 }}} 23 24 In the new version it gives: 25 26 {{{ 27 sage: print(TCube.Hrepresentation_str()) 28 -x0 >= -1 29 -x1 >= -1 30 -3*x0 + 3*x1 - 3*x2 >= -7 31 x0 >= -1 32 x1 >= -1 33 3*x0 - 3*x1 - 3*x2 >= -7 34 3*x0 + 3*x1 - 3*x2 >= -7 35 3*x0 - 3*x1 + 3*x2 >= -7 36 3*x0 + 3*x1 + 3*x2 >= -7 37 x2 >= -1 38 -x2 >= -1 39 -3*x0 + 3*x1 + 3*x2 >= -7 40 -3*x0 - 3*x1 + 3*x2 >= -7 41 -3*x0 - 3*x1 - 3*x2 >= -7 42 43 sage: print(TCube.Hrepresentation_str(latex=True)) 44 \begin{array}{rcl} 45 -x_{0} & \geq & -1 \\ 46 -x_{1} & \geq & -1 \\ 47 -3 \, x_{0} + 3 \, x_{1} - 3 \, x_{2} & \geq & -7 \\ 48 x_{0} & \geq & -1 \\ 49 x_{1} & \geq & -1 \\ 50 3 \, x_{0} - 3 \, x_{1} - 3 \, x_{2} & \geq & -7 \\ 51 3 \, x_{0} + 3 \, x_{1} - 3 \, x_{2} & \geq & -7 \\ 52 3 \, x_{0} - 3 \, x_{1} + 3 \, x_{2} & \geq & -7 \\ 53 3 \, x_{0} + 3 \, x_{1} + 3 \, x_{2} & \geq & -7 \\ 54 x_{2} & \geq & -1 \\ 55 -x_{2} & \geq & -1 \\ 56 -3 \, x_{0} + 3 \, x_{1} + 3 \, x_{2} & \geq & -7 \\ 57 -3 \, x_{0} - 3 \, x_{1} + 3 \, x_{2} & \geq & -7 \\ 58 -3 \, x_{0} - 3 \, x_{1} - 3 \, x_{2} & \geq & -7 59 \end{array} 60 }}} 61 62 The `style` parameter allows to change the way to print the H-relations: 63 64 {{{ 65 sage: P = polytopes.permutahedron(3) 66 sage: print(P.Hrepresentation_str(style='<=')) 67 -x0 - x1 - x2 == -6 68 x1 + x2 <= 5 69 x2 <= 3 70 x1 <= 3 71 -x1 <= -1 72 -x1 - x2 <= -3 73 -x2 <= -1 74 }}} 75 76 In order to make the function more apparent, deprecation of the current function is perhaps a good idea and change the name to `Hrepresentation_str`.