5 #include <polylib/polylibgmp.h>
7 #include <barvinok/evalue.h>
8 #include <barvinok/options.h>
10 struct EDomain_floor
{
15 EDomain_floor(const evalue
*f
, int dim
);
21 EDomain_floor
*ref() {
25 static void unref(EDomain_floor
* floor
) {
26 if (!--floor
->refcount
)
29 void print(std::ostream
& os
, char **p
) const;
30 void eval(Value
*values
, Value
*res
) const;
36 std::vector
<EDomain_floor
*> floors
;
38 EDomain(Polyhedron
*D
) {
39 this->D
= Polyhedron_Copy(D
);
42 EDomain(Polyhedron
*D
, std::vector
<EDomain_floor
*>floors
) {
43 this->D
= Polyhedron_Copy(D
);
47 EDomain(EDomain
*ED
) {
48 this->D
= Polyhedron_Copy(ED
->D
);
49 add_floors(ED
->floors
);
52 EDomain(Polyhedron
*D
, EDomain
*ED
, std::vector
<EDomain_floor
*>floors
) {
53 this->D
= Polyhedron_Copy(D
);
54 add_floors(ED
->floors
);
58 void add_floors(std::vector
<EDomain_floor
*>floors
) {
59 for (int i
= 0; i
< floors
.size(); ++i
)
60 this->floors
.push_back(floors
[i
]->ref());
62 int find_floor(evalue
*needle
) const {
63 for (int i
= 0; i
< floors
.size(); ++i
)
64 if (eequal(needle
, floors
[i
]->e
))
68 void print(FILE *out
, char **p
);
69 void print_constraints(std::ostream
& os
, char **p
,
70 barvinok_options
*options
) const;
72 for (int i
= 0; i
< floors
.size(); ++i
)
73 EDomain_floor::unref(floors
[i
]);
79 unsigned dimension() const {
80 return D
->Dimension
- floors
.size();
82 bool contains(Value
*point
, int len
) const;
84 Matrix
*add_ge_constraint(evalue
*constraint
,
85 std::vector
<EDomain_floor
*>& new_floors
) const;
88 int evalue2constraint(EDomain
*D
, evalue
*E
, Value
*cons
, int len
);