9 #include <barvinok/evalue.h>
10 #include <barvinok/barvinok.h>
12 /* gcc -shared -g collect_nonsimple.c -rdynamic -o libcollect.so -ldl -lc -lgmp */
14 Polyhedron
* triangularize_cone(Polyhedron
*P
, unsigned MaxRays
)
16 static Polyhedron
*(*orig
)(Polyhedron
*, unsigned) = NULL
;
17 static char *prefix
= NULL
;
19 static int recurse
= 0;
20 static int counter
= 0;
23 void *handle
= dlopen("libbarvinok.so", RTLD_LAZY
);
25 orig
= dlsym(handle
, "triangularize_cone");
29 prefix
= getenv("POLYTOPE_PREFIX");
31 prefix
= strdup(prefix
);
34 if (prefix
&& !recurse
) {
40 snprintf(path
, PATH_MAX
, "%s-%05d-%05d", prefix
, getpid(), counter
++);
42 fprintf(f
, "%d %d\n", nr
=P
->NbRays
, nc
=P
->Dimension
+2);
43 for (i
=0; i
< nr
; i
++) {
44 for (j
=0; j
< nc
; j
++) {
45 value_print(f
," "P_VALUE_FMT
" ", P
->Ray
[i
][j
]);
53 res
= orig(P
, MaxRays
);