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: terms in numerator */
19 /* coeff has two columns: the numerator and the denominator */
23 struct __short_rat_d
{
24 /* rows: factors in denominator */
27 void add(short_rat
*rat
);
30 short_rat(const QQ
& c
, const vec_ZZ
& num
, const mat_ZZ
& den
);
34 struct short_rat_lex_smaller_denominator
{
35 bool operator()(const short_rat
* r1
, const short_rat
* r2
) const;
38 typedef std::set
<short_rat
*, short_rat_lex_smaller_denominator
> short_rat_list
;
44 void add(const QQ
& c
, const vec_ZZ
& num
, const mat_ZZ
& den
);
46 void add(const QQ
& c
, const gen_fun
*gf
);
47 void substitute(Matrix
*CP
);
48 gen_fun
*Hadamard_product(const gen_fun
*gf
, barvinok_options
*options
);
49 void add_union(gen_fun
*gf
, barvinok_options
*options
);
50 void shift(const vec_ZZ
& offset
);
51 void divide(const vec_ZZ
& power
);
52 void print(std::ostream
& os
, unsigned int nparam
, char **param_name
) const;
53 operator evalue
*() const;
54 void coefficient(Value
* params
, Value
* c
) const;
55 gen_fun
*summate(int nvar
, barvinok_options
*options
) const;
56 bool summate(Value
*sum
) const;
58 gen_fun(const gen_fun
*gf
) {
60 context
= Polyhedron_Copy(gf
->context
);
64 gen_fun(Polyhedron
*C
= NULL
) : context(C
) {}
67 Polyhedron_Free(context
);
68 for (short_rat_list::iterator i
= term
.begin(); i
!= term
.end(); ++i
)