@@ -63,6 +63,43 @@ function halfspace_matrix_pair(
63
63
end
64
64
end
65
65
66
+ function halfspace_matrix_pair (
67
+ R:: ZZRing ,
68
+ iter:: SubObjectIterator {
69
+ <: Union {
70
+ Halfspace{QQFieldElem},
71
+ Hyperplane{QQFieldElem},
72
+ Polyhedron{QQFieldElem},
73
+ Cone{QQFieldElem},
74
+ Pair{Matrix{QQFieldElem},QQFieldElem},
75
+ }
76
+ };
77
+ integral_bias:: Bool = true ,
78
+ )
79
+ if integral_bias
80
+ try
81
+ h = Polymake. common. primitive (affine_matrix_for_polymake (iter))
82
+ return (A= matrix (ZZ, h[:, 2 : end ]), b= [ZZ (x) for x in - h[:, 1 ]])
83
+ catch e
84
+ throw (ArgumentError (" Halfspace-Matrix-Pair not defined in this context." ))
85
+ end
86
+ else
87
+ try
88
+ h = affine_matrix_for_polymake (iter)
89
+ hm = Polymake. common. primitive (h[:, 2 : end ])
90
+ bv = Vector {QQFieldElem} (undef, size (hm, 1 ))
91
+ for i in 1 : size (hm, 1 )
92
+ j = findfirst (! is_zero, hm[i, :])
93
+ r = hm[i, j]// h[i, j + 1 ]
94
+ bv[i] = - QQ (h[i, 1 ] * r)
95
+ end
96
+ return (A= matrix (ZZ, hm), b= bv)
97
+ catch e
98
+ throw (ArgumentError (" Halfspace-Matrix-Pair not defined in this context." ))
99
+ end
100
+ end
101
+ end
102
+
66
103
for fun in (cones, faces, facets, maximal_cones, maximal_polyhedra, rays, vertices)
67
104
F = Symbol (fun)
68
105
@eval $ F (:: Type{IncidenceMatrix} , x... ) = IncidenceMatrix ($ F (x... ))
0 commit comments