3 #include <barvinok/evalue.h>
4 #include <barvinok/barvinok.h>
6 /* gcc -shared count_domain.c -rdynamic -o libcount.so -ldl -lc */
8 evalue
* barvinok_enumerate_ev(Polyhedron
*P
, Polyhedron
* C
, unsigned MaxRays
)
10 static evalue
*(*orig
)(Polyhedron
*, Polyhedron
*c
, unsigned) = NULL
;
15 void *handle
= dlopen("libbarvinok.so", RTLD_LAZY
);
17 orig
= dlsym(handle
, "barvinok_enumerate_ev");
22 res
= orig(P
, C
, MaxRays
);
24 c
= value_notzero_p(res
->d
) ? 0
25 : res
->x
.p
->type
== partition
? res
->x
.p
->size
/2 : 1;
26 fprintf(stderr
, "COUNT: %d %d %d %d\n", P
->Dimension
,
27 C
->Dimension
, c
, P
->Dimension
- P
->NbEq
/*, domain_size(P)*/);