2 #include <NTL/mat_ZZ.h>
3 #include <barvinok/util.h>
4 #include <barvinok/genfun.h>
5 #include <barvinok/options.h>
13 /* base for generating function counting */
18 gf_base(np_base
*npb
, Polyhedron
*context
) : base(npb
) {
19 gf
= new gen_fun(context
);
23 static gf_base
*create(Polyhedron
*context
, unsigned dim
, unsigned nparam
,
24 barvinok_options
*options
);
26 void start_gf(Polyhedron
*P
, barvinok_options
*options
) {
27 base
->start(P
, options
);
31 struct partial_ireducer
: public ireducer
, public gf_base
{
32 partial_ireducer(Polyhedron
*context
, unsigned dim
, unsigned nparam
) :
33 ireducer(dim
), gf_base(this, context
) {
38 virtual void base(QQ
& c
, const vec_ZZ
& num
, const mat_ZZ
& den_f
);
39 virtual gen_fun
*get_gf() {
44 struct partial_reducer
: public reducer
, public gf_base
{
48 partial_reducer(Polyhedron
*context
, unsigned dim
, unsigned nparam
) :
49 reducer(dim
), gf_base(this, context
) {
52 tmp
.SetLength(dim
- nparam
);
54 virtual void init(Polyhedron
*P
) {
55 randomvector(P
, lambda
, dim
- lower
);
59 virtual void base(QQ
& c
, const vec_ZZ
& num
, const mat_ZZ
& den_f
);
61 virtual void split(vec_ZZ
& num
, ZZ
& num_s
, vec_ZZ
& num_p
,
62 mat_ZZ
& den_f
, vec_ZZ
& den_s
, mat_ZZ
& den_r
);
63 virtual gen_fun
*get_gf() {
68 struct partial_bfcounter
: public bfcounter_base
, public gf_base
{
69 partial_bfcounter(Polyhedron
*context
, unsigned dim
, unsigned nparam
) :
70 bfcounter_base(dim
), gf_base(this, context
) {
73 ~partial_bfcounter() {
75 virtual void base(mat_ZZ
& factors
, bfc_vec
& v
);