3 #include <polylib/polylibgmp.h>
4 #include <barvinok/evalue.h>
5 #include <barvinok/util.h>
6 #include <barvinok/barvinok.h>
9 /* The input of this example program is the same as that of testehrhart
10 * in the PolyLib distribution, i.e., a polytope in combined
11 * data and parameter space, a context polytope in parameter space
12 * and (optionally) the names of the parameters.
13 * Both polytopes are in PolyLib notation.
16 #ifdef HAVE_GROWING_CHERNIKOVA
17 #define MAXRAYS POL_NO_DUAL
23 #define getopt_long(a,b,c,d,e) getopt(a,b,c)
26 struct option options
[] = {
27 { "convert", no_argument
, 0, 'c' },
28 { "floor", no_argument
, 0, 'f' },
29 { "size", no_argument
, 0, 's' },
30 { "version", no_argument
, 0, 'V' },
35 int main(int argc
, char **argv
)
46 while ((c
= getopt_long(argc
, argv
, "fcsV", options
, &ind
)) != -1) {
58 printf(barvinok_version());
65 A
= Constraints2Polyhedron(M
, MAXRAYS
);
68 C
= Constraints2Polyhedron(M
, MAXRAYS
);
70 Polyhedron_Print(stdout
, P_VALUE_FMT
, A
);
71 Polyhedron_Print(stdout
, P_VALUE_FMT
, C
);
72 param_name
= Read_ParamNames(stdin
, C
->Dimension
);
73 EP
= barvinok_enumerate_ev(A
, C
, MAXRAYS
);
74 print_evalue(stdout
, EP
, param_name
);
76 printf("\nSize: %d\n", evalue_size(EP
));
78 fprintf(stderr
, "WARNING: floor conversion not supported\n");
79 evalue_frac2floor(EP
);
80 print_evalue(stdout
, EP
, param_name
);
82 evalue_mod2table(EP
, C
->Dimension
);
83 print_evalue(stdout
, EP
, param_name
);
85 printf("\nSize: %d\n", evalue_size(EP
));
89 Free_ParamNames(param_name
, C
->Dimension
);