2 #include <NTL/mat_ZZ.h>
4 #include <polylib/polylibgmp.h>
6 #include <barvinok/util.h>
7 #include <barvinok/genfun.h>
8 #include <barvinok/options.h>
10 #include "bfcounter.h"
16 /* base for generating function counting */
21 gf_base(np_base
*npb
, Polyhedron
*context
) : base(npb
) {
22 gf
= new gen_fun(context
);
26 static gf_base
*create(Polyhedron
*context
, unsigned dim
, unsigned nparam
,
27 barvinok_options
*options
);
29 void start_gf(Polyhedron
*P
, barvinok_options
*options
) {
30 base
->start(P
, options
);
34 struct partial_ireducer
: public ireducer
, public gf_base
{
35 partial_ireducer(Polyhedron
*context
, unsigned dim
, unsigned nparam
) :
36 ireducer(dim
), gf_base(this, context
) {
41 virtual void base(QQ
& c
, const vec_ZZ
& num
, const mat_ZZ
& den_f
);
42 virtual gen_fun
*get_gf() {
47 struct partial_reducer
: public reducer
, public gf_base
{
51 partial_reducer(Polyhedron
*context
, unsigned dim
, unsigned nparam
) :
52 reducer(dim
), gf_base(this, context
) {
55 tmp
.SetLength(dim
- nparam
);
57 virtual void init(Polyhedron
*P
) {
58 randomvector(P
, lambda
, dim
- lower
);
62 virtual void base(QQ
& c
, const vec_ZZ
& num
, const mat_ZZ
& den_f
);
64 virtual void split(vec_ZZ
& num
, ZZ
& num_s
, vec_ZZ
& num_p
,
65 mat_ZZ
& den_f
, vec_ZZ
& den_s
, mat_ZZ
& den_r
);
66 virtual gen_fun
*get_gf() {
71 struct partial_bfcounter
: public bfcounter_base
, public gf_base
{
72 partial_bfcounter(Polyhedron
*context
, unsigned dim
, unsigned nparam
) :
73 bfcounter_base(dim
), gf_base(this, context
) {
76 ~partial_bfcounter() {
78 virtual void base(mat_ZZ
& factors
, bfc_vec
& v
);