2 #include <polylib/polylibgmp.h>
3 #include "ev_operations.h"
8 /* The input of this example program is a polytope in combined
9 * data and parameter space followed by two lines indicating
10 * the number of existential variables and parameters respectively.
11 * The first lines starts with "E ", followed by a number.
12 * The second lines starts with "P ", followed by a number.
13 * These two lines are (optionally) followed by the names of the parameters.
14 * The polytope is in PolyLib notation.
17 #ifdef HAVE_GROWING_CHERNIKOVA
24 #define getopt_long(a,b,c,d,e) getopt(a,b,c)
27 struct option options
[] = {
28 { "pip", no_argument
, 0, 'p' },
29 { "convert", no_argument
, 0, 'c' },
30 { "floor", no_argument
, 0, 'f' },
31 { "range", no_argument
, 0, 'r' },
36 int main(int argc
, char **argv
)
50 while ((c
= getopt_long(argc
, argv
, "pfcr", options
, &ind
)) != -1) {
68 A
= Constraints2Polyhedron(M
, MAXRAYS
);
72 while ((*s
=='#') || (sscanf(s
, "E %d", &exist
)<1))
76 while ((*s
=='#') || (sscanf(s
, "P %d", &nparam
)<1))
79 Polyhedron_Print(stdout
, P_VALUE_FMT
, A
);
80 printf("exist: %d, nparam: %d\n", exist
, nparam
);
81 param_name
= Read_ParamNames(stdin
, nparam
);
83 EP
= barvinok_enumerate_pip(A
, exist
, nparam
, MAXRAYS
);
85 EP
= barvinok_enumerate_e(A
, exist
, nparam
, MAXRAYS
);
89 evalue_range_reduction(EP
);
90 print_evalue(stdout
, EP
, param_name
);
92 fprintf(stderr
, "WARNING: floor conversion not supported\n");
93 evalue_frac2floor(EP
);
94 print_evalue(stdout
, EP
, param_name
);
96 evalue_mod2table(EP
, nparam
);
97 print_evalue(stdout
, EP
, param_name
);
101 Free_ParamNames(param_name
, nparam
);