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