1 #include <barvinok/options.h>
7 evalue
*barvinok_summate(evalue
*e
, int nvar
, struct barvinok_options
*options
)
9 if (options
->summation
== BV_SUM_EULER
)
10 return euler_summate(e
, nvar
, options
);
11 else if (options
->summation
== BV_SUM_LAURENT
)
12 return laurent_summate(e
, nvar
, options
);
13 else if (options
->summation
== BV_SUM_BERNOULLI
)
14 return Bernoulli_sum_evalue(e
, nvar
, options
);
16 return evalue_sum(e
, nvar
, options
->MaxRays
);
19 /* Turn unweighted counting problem into "weighted" counting problem
20 * with weight equal to 1 and call barvinok_summate on this weighted problem.
22 evalue
*barvinok_summate_unweighted(Polyhedron
*P
, Polyhedron
*C
,
23 struct barvinok_options
*options
)
29 if (emptyQ(P
) || emptyQ(C
))
32 CA
= align_context(C
, P
->Dimension
, options
->MaxRays
);
33 D
= DomainIntersection(P
, CA
, options
->MaxRays
);
42 e
.x
.p
= new_enode(partition
, 2, P
->Dimension
);
43 EVALUE_SET_DOMAIN(e
.x
.p
->arr
[0], D
);
44 evalue_set_si(&e
.x
.p
->arr
[1], 1, 1);
45 sum
= barvinok_summate(&e
, P
->Dimension
- C
->Dimension
, options
);