2 #include <polylib/polylibgmp.h>
3 #include "ev_operations.h"
8 /* The input of this example program is the same as that of testehrhart
9 * in the PolyLib distribution, i.e., a polytope in combined
10 * data and parameter space, a context polytope in parameter space
11 * and (optionally) the names of the parameters.
12 * Both polytopes are in PolyLib notation.
15 #ifdef HAVE_GROWING_CHERNIKOVA
22 #define getopt_long(a,b,c,d,e) getopt(a,b,c)
25 struct option options
[] = {
26 { "convert", no_argument
, 0, 'c' },
27 { "floor", no_argument
, 0, 'f' },
28 { "size", no_argument
, 0, 's' },
33 int main(int argc
, char **argv
)
44 while ((c
= getopt_long(argc
, argv
, "fcs", options
, &ind
)) != -1) {
59 A
= Constraints2Polyhedron(M
, MAXRAYS
);
62 C
= Constraints2Polyhedron(M
, MAXRAYS
);
64 Polyhedron_Print(stdout
, P_VALUE_FMT
, A
);
65 Polyhedron_Print(stdout
, P_VALUE_FMT
, C
);
66 param_name
= Read_ParamNames(stdin
, C
->Dimension
);
67 EP
= barvinok_enumerate_ev(A
, C
, MAXRAYS
);
68 print_evalue(stdout
, EP
, param_name
);
70 printf("\nSize: %d\n", evalue_size(EP
));
72 fprintf(stderr
, "WARNING: floor conversion not supported\n");
73 evalue_frac2floor(EP
);
74 print_evalue(stdout
, EP
, param_name
);
76 evalue_mod2table(EP
, C
->Dimension
);
77 print_evalue(stdout
, EP
, param_name
);
79 printf("\nSize: %d\n", evalue_size(EP
));
83 Free_ParamNames(param_name
, C
->Dimension
);