1 #include <barvinok/util.h>
4 static enum order_sign
interval_minmax(Polyhedron
*I
)
9 assert(I
->Dimension
== 1);
10 POL_ENSURE_VERTICES(I
);
11 for (i
= 0; i
< I
->NbRays
; ++i
) {
12 if (value_pos_p(I
->Ray
[i
][1]))
14 else if (value_neg_p(I
->Ray
[i
][1]))
36 /* Returns the sign of the affine function specified by T on the polyhedron D */
37 enum order_sign
PL_polyhedron_affine_sign(Polyhedron
*D
, Matrix
*T
,
38 struct barvinok_options
*options
)
41 Polyhedron
*I
= Polyhedron_Image(D
, T
, options
->MaxRays
);
42 if (POL_ISSET(options
->MaxRays
, POL_INTEGER
))
43 I
= DomainConstraintSimplify(I
, options
->MaxRays
);
46 I
= Polyhedron_Image(D
, T
, options
->MaxRays
);
48 sign
= interval_minmax(I
);