4 #include <barvinok/set.h>
7 #include <NTL/mat_ZZ.h>
8 #include <barvinok/evalue.h>
9 #include <barvinok/NTL_QQ.h>
10 #include <barvinok/options.h>
17 struct __short_rat_n
{
18 /* rows of power/columns of coeff: terms in numerator */
22 struct __short_rat_d
{
23 /* rows: factors in denominator */
26 void add(const short_rat
*rat
);
27 QQ
coefficient(Value
* params
, barvinok_options
*options
) const;
29 short_rat(const short_rat
& r
);
31 short_rat(const QQ
& c
, const vec_ZZ
& num
, const mat_ZZ
& den
);
32 short_rat(const vec_QQ
& c
, const mat_ZZ
& num
, const mat_ZZ
& den
);
34 void print(std::ostream
& os
, unsigned int nparam
, char **param_name
) const;
37 struct short_rat_lex_smaller_denominator
{
38 bool operator()(const short_rat
* r1
, const short_rat
* r2
) const;
41 typedef std::set
<short_rat
*, short_rat_lex_smaller_denominator
> short_rat_list
;
47 void add(const QQ
& c
, const vec_ZZ
& num
, const mat_ZZ
& den
);
48 void add(short_rat
*r
);
50 void add(const QQ
& c
, const gen_fun
*gf
);
51 void substitute(Matrix
*CP
);
52 gen_fun
*Hadamard_product(const gen_fun
*gf
, barvinok_options
*options
);
53 void add_union(gen_fun
*gf
, barvinok_options
*options
);
54 void shift(const vec_ZZ
& offset
);
55 void divide(const vec_ZZ
& power
);
56 void print(std::ostream
& os
, unsigned int nparam
, char **param_name
) const;
57 static gen_fun
*read(std::istream
& is
, barvinok_options
*options
);
58 operator evalue
*() const;
59 ZZ
coefficient(Value
* params
, barvinok_options
*options
) const;
60 void coefficient(Value
* params
, Value
* c
) const;
61 gen_fun
*summate(int nvar
, barvinok_options
*options
) const;
62 bool summate(Value
*sum
) const;
64 gen_fun(const gen_fun
*gf
) {
66 context
= Polyhedron_Copy(gf
->context
);
70 gen_fun(Polyhedron
*C
= NULL
) : context(C
) {}
72 for (short_rat_list::iterator i
= term
.begin(); i
!= term
.end(); ++i
)
78 Polyhedron_Free(context
);
83 std::ostream
& operator<< (std::ostream
& os
, const gen_fun
& gf
);