4 #include <polylib/polylibgmp.h>
5 #include <barvinok/util.h>
6 #include <barvinok/barvinok.h>
9 #ifdef HAVE_GROWING_CHERNIKOVA
10 #define MAXRAYS (POL_NO_DUAL | POL_INTEGER)
16 #define getopt_long(a,b,c,d,e) getopt(a,b,c)
19 struct option options
[] = {
20 { "version", no_argument
, 0, 'V' },
25 static Polyhedron
*Polyhedron_Read()
28 unsigned NbRows
, NbColumns
;
33 while (fgets(s
, sizeof(s
), stdin
)) {
36 if (strncasecmp(s
, "vertices", sizeof("vertices")-1) == 0)
38 if (sscanf(s
, "%u %u", &NbRows
, &NbColumns
) == 2)
43 M
= Matrix_Alloc(NbRows
,NbColumns
);
46 P
= Rays2Polyhedron(M
, MAXRAYS
);
48 P
= Constraints2Polyhedron(M
, MAXRAYS
);
53 int main(int argc
, char **argv
)
59 while ((c
= getopt_long(argc
, argv
, "V", options
, &ind
)) != -1) {
62 printf(barvinok_version());
68 A
= Polyhedron_Read();
70 Polyhedron_Print(stdout
, P_VALUE_FMT
, A
);
71 barvinok_count(A
, &cb
, MAXRAYS
);
72 value_print(stdout
, P_VALUE_FMT
, cb
);