8 #include <NTL/vec_ZZ.h>
9 #include <barvinok/polylib.h>
10 #include "conversion.h"
19 dpoly(int d
, ZZ
& degree
, int offset
= 0);
20 void operator += (const dpoly
& t
);
21 void operator *= (const ZZ
& f
);
22 void operator *= (dpoly
& f
);
23 void div(dpoly
& d
, mpq_t count
, ZZ
& sign
);
24 void div(dpoly
& d
, mpq_t
*count
, const mpq_t
& factor
);
26 mpq_t
*div(dpoly
&d
) const;
27 void clear_div(mpq_t
*c
) const;
30 /* Each element in powers corresponds to a factor of the form (1 - z^b)
31 * and indicates the exponent of this factor in the denominator.
32 * The constants b are stored elsewhere (den_r in reducer::reducer).
35 std::vector
<int> powers
;
39 struct dpoly_r_term_lex_smaller
{
40 bool operator()(const dpoly_r_term
* t1
, const dpoly_r_term
* t2
) const {
41 return t1
->powers
< t2
->powers
;
45 typedef std::set
<dpoly_r_term
*, dpoly_r_term_lex_smaller
> dpoly_r_term_list
;
47 /* len: number of elements in c
48 * each element in c is the coefficient of a power of t
49 * in the MacLaurin expansion
57 void add_term(int i
, const std::vector
<int>& powers
, const ZZ
& coeff
);
58 dpoly_r(int len
, int dim
);
59 dpoly_r(dpoly
& num
, int dim
);
60 dpoly_r(dpoly
& num
, dpoly
& den
, int pos
, int dim
);
61 dpoly_r(const dpoly_r
* num
, dpoly
& den
, int pos
, int dim
);
63 dpoly_r
*div(const dpoly
& d
) const;