2 #include <NTL/mat_ZZ.h>
4 #include <polylib/polylibgmp.h>
6 #include <barvinok/util.h>
7 #include <barvinok/genfun.h>
15 /* base for generating function counting */
20 gf_base(np_base
*npb
, Polyhedron
*context
) : base(npb
) {
21 gf
= new gen_fun(context
);
25 static gf_base
*create(Polyhedron
*context
, unsigned dim
, unsigned nparam
);
27 void start_gf(Polyhedron
*P
, unsigned MaxRays
) {
28 base
->start(P
, MaxRays
);
32 struct partial_ireducer
: public ireducer
, public gf_base
{
33 partial_ireducer(Polyhedron
*context
, unsigned dim
, unsigned nparam
) :
34 ireducer(dim
), gf_base(this, context
) {
39 virtual void base(QQ
& c
, const vec_ZZ
& num
, const mat_ZZ
& den_f
);
42 struct partial_reducer
: public reducer
, public gf_base
{
46 partial_reducer(Polyhedron
*context
, unsigned dim
, unsigned nparam
) :
47 reducer(dim
), gf_base(this, context
) {
50 tmp
.SetLength(dim
- nparam
);
52 virtual void init(Polyhedron
*P
) {
53 randomvector(P
, lambda
, dim
- lower
);
57 virtual void base(QQ
& c
, const vec_ZZ
& num
, const mat_ZZ
& den_f
);
59 virtual void split(vec_ZZ
& num
, ZZ
& num_s
, vec_ZZ
& num_p
,
60 mat_ZZ
& den_f
, vec_ZZ
& den_s
, mat_ZZ
& den_r
);
63 struct partial_bfcounter
: public bfcounter_base
, public gf_base
{
64 partial_bfcounter(Polyhedron
*context
, unsigned dim
, unsigned nparam
) :
65 bfcounter_base(dim
), gf_base(this, context
) {
68 ~partial_bfcounter() {
70 virtual void base(mat_ZZ
& factors
, bfc_vec
& v
);