4 #include <barvinok/set.h>
7 #include <NTL/vec_ZZ.h>
8 #include <barvinok/polylib.h>
9 #include "conversion.h"
16 dpoly(const dpoly
& o
) {
17 coeff
= Vector_Alloc(o
.coeff
->Size
);
18 Vector_Copy(o
.coeff
->p
, coeff
->p
, o
.coeff
->Size
);
21 coeff
= Vector_Alloc(d
+1);
23 dpoly(int d
, const Value degree
, int offset
= 0);
27 void operator += (const dpoly
& t
);
28 void operator *= (const Value f
);
29 void operator *= (const dpoly
& f
);
30 void div(const dpoly
& d
, mpq_t count
, int sign
);
31 void div(const dpoly
& d
, mpq_t
*count
, const mpq_t
& factor
);
32 Vector
*div(const dpoly
&d
);
35 /* Each element in powers corresponds to a factor of the form (1 - z^b)
36 * and indicates the exponent of this factor in the denominator.
37 * The constants b are stored elsewhere (den_r in reducer::reducer).
40 std::vector
<int> powers
;
44 struct dpoly_r_term_lex_smaller
{
45 bool operator()(const dpoly_r_term
* t1
, const dpoly_r_term
* t2
) const {
46 return t1
->powers
< t2
->powers
;
50 typedef std::set
<dpoly_r_term
*, dpoly_r_term_lex_smaller
> dpoly_r_term_list
;
52 /* len: number of elements in c
53 * each element in c is the coefficient of a power of t
54 * in the MacLaurin expansion
62 void add_term(int i
, const std::vector
<int>& powers
, const ZZ
& coeff
);
63 dpoly_r(int len
, int dim
);
64 dpoly_r(dpoly
& num
, int dim
);
65 dpoly_r(dpoly
& num
, dpoly
& den
, int pos
, int dim
);
66 dpoly_r(const dpoly_r
* num
, dpoly
& den
, int pos
, int dim
);
68 dpoly_r
*div(const dpoly
& d
) const;