7 #include <barvinok/evalue.h>
8 #include <barvinok/barvinok.h>
10 /* gcc -shared -g collect_polytopes2.c -rdynamic -o libcollect2.so -ldl -lc -lgmp */
12 evalue
* barvinok_enumerate_ev(Polyhedron
*P
, Polyhedron
* C
, unsigned MaxRays
)
14 static evalue
*(*orig
)(Polyhedron
*, Polyhedron
*c
, unsigned) = NULL
;
15 static char *prefix
= NULL
;
17 static int counter
= 0;
19 fprintf(stderr
, "IN INSTRUMENTED BARVINOK_ENUMERATE_EV");
22 void *handle
= dlopen("libbarvinok.so", RTLD_LAZY
);
24 orig
= dlsym(handle
, "barvinok_enumerate_ev");
28 prefix
= getenv("POLYTOPE_PREFIX");
30 prefix
= strdup(prefix
);
39 snprintf(path
, PATH_MAX
, "%s%05d", prefix
, counter
++);
41 fprintf(f
, "%d %d\n", nr
=P
->NbConstraints
, nc
=P
->Dimension
+2);
42 for (i
=0; i
< nr
; i
++) {
43 for (j
=0; j
< nc
; j
++) {
44 value_print(f
," "P_VALUE_FMT
" ", P
->Constraint
[i
][j
]);
48 fprintf(f
, "\n0 %d\n", C
->Dimension
+2);
52 res
= orig(P
, C
, MaxRays
);