barvinok.cc: remove ancient debugging code
[barvinok.git] / barvinok_union.c
blobee2bf7a3c016eec3b1741b1bc4b78b920482d48d
1 #include <barvinok/barvinok.h>
2 #include <barvinok/util.h>
3 #include "config.h"
5 /* The input of this example program is similar to that of ehrhart_union
6 * in the PolyLib distribution, the difference being that the number of
7 * polytopes in the union needs to specified explicitly.
8 * The input starts with this number, followed by this number of
9 * polytopes in combined data and parameter space, a context polytope
10 * in parameter space and (optionally) the names of the parameters.
11 * All polytopes are in PolyLib notation.
14 #ifdef HAVE_GROWING_CHERNIKOVA
15 #define MAXRAYS POL_NO_DUAL
16 #else
17 #define MAXRAYS 600
18 #endif
20 int main(int argc, char **argv)
22 Matrix *M;
23 Polyhedron *C, *D = NULL;
24 evalue *EP;
25 int i, npol;
26 char **param_name;
27 char s[128];
29 fgets(s, 128, stdin);
30 while ((*s=='#') || (sscanf(s, "%d", &npol)<1))
31 fgets(s, 128, stdin);
33 for (i = 0; i < npol; ++i) {
34 Polyhedron *P;
35 M = Matrix_Read();
36 P = Constraints2Polyhedron(M, MAXRAYS);
37 Matrix_Free(M);
38 D = DomainConcat(P, D);
40 M = Matrix_Read();
41 C = Constraints2Polyhedron(M, MAXRAYS);
42 Matrix_Free(M);
43 Polyhedron_Print(stdout, P_VALUE_FMT, D);
44 Polyhedron_Print(stdout, P_VALUE_FMT, C);
45 param_name = Read_ParamNames(stdin, C->Dimension);
46 EP = barvinok_enumerate_union(D, C, MAXRAYS);
47 print_evalue(stdout, EP, param_name);
48 free_evalue_refs(EP);
49 free(EP);
50 Free_ParamNames(param_name, C->Dimension);
51 Domain_Free(D);
52 Polyhedron_Free(C);
53 return 0;