minor extra merge
[barvinok.git] / barvinok_series.cc
blobdf715df558101282c59c22875876b6e5993eafb2
1 #include <unistd.h>
2 #include <sys/times.h>
3 #include <gmp.h>
4 #include <NTL/mat_ZZ.h>
5 extern "C" {
6 #include <polylib/polylibgmp.h>
7 #include "ev_operations.h"
9 #include <util.h>
10 #include <barvinok.h>
11 #include <barvinok2.h>
12 #include "config.h"
14 /* The input of this example program is the same as that of testehrhart
15 * in the PolyLib distribution, i.e., a polytope in combined
16 * data and parameter space, a context polytope in parameter space
17 * and (optionally) the names of the parameters.
18 * Both polytopes are in PolyLib notation.
21 #ifdef HAVE_GROWING_CHERNIKOVA
22 #define MAXRAYS 0
23 #else
24 #define MAXRAYS 600
25 #endif
27 int main(int argc, char **argv)
29 Polyhedron *A, *C;
30 Matrix *M;
31 Enumeration *en;
32 char **param_name;
33 gen_fun *gf;
35 M = Matrix_Read();
36 A = Constraints2Polyhedron(M, MAXRAYS);
37 Matrix_Free(M);
38 M = Matrix_Read();
39 C = Constraints2Polyhedron(M, MAXRAYS);
40 Matrix_Free(M);
41 Polyhedron_Print(stdout, P_VALUE_FMT, A);
42 Polyhedron_Print(stdout, P_VALUE_FMT, C);
43 param_name = Read_ParamNames(stdin, C->Dimension);
44 gf = barvinok_series(A, C, MAXRAYS);
45 gf->print(C->Dimension, param_name);
46 Free_ParamNames(param_name, C->Dimension);
47 Polyhedron_Free(A);
48 Polyhedron_Free(C);
49 return 0;