3 #include <barvinok/evalue.h>
4 #include <barvinok/options.h>
8 bool substituted
; // see substitute method
11 /* first element is denominator */
14 EDomain_floor(const evalue
*f
, int dim
);
20 EDomain_floor
*ref() {
24 static void unref(EDomain_floor
* floor
) {
25 if (!--floor
->refcount
)
28 void print(std::ostream
& os
, char **p
) const;
29 void eval(Value
*values
, Value
*res
) const;
30 void substitute(evalue
**sub
, Matrix
*T
);
35 struct ge_constraint
{
36 const EDomain
* const D
;
38 std::vector
<EDomain_floor
*> new_floors
;
41 ge_constraint(const EDomain
*const D
) : D(D
) {}
43 for (int i
= 0; i
< new_floors
.size(); ++i
)
44 EDomain_floor::unref(new_floors
[i
]);
52 std::vector
<EDomain_floor
*> floors
;
54 EDomain(Polyhedron
*D
) {
55 this->D
= Polyhedron_Copy(D
);
58 EDomain(Polyhedron
*D
, std::vector
<EDomain_floor
*>floors
) {
59 this->D
= Polyhedron_Copy(D
);
63 EDomain(EDomain
*ED
) {
64 this->D
= Polyhedron_Copy(ED
->D
);
65 add_floors(ED
->floors
);
68 static EDomain
*new_from_ge_constraint(ge_constraint
*ge
, int sign
,
69 barvinok_options
*options
);
70 EDomain(Polyhedron
*D
, const EDomain
*const ED
,
71 std::vector
<EDomain_floor
*>floors
) {
72 this->D
= Polyhedron_Copy(D
);
73 add_floors(ED
->floors
);
77 void add_floors(std::vector
<EDomain_floor
*>floors
) {
78 for (int i
= 0; i
< floors
.size(); ++i
)
79 this->floors
.push_back(floors
[i
]->ref());
81 int find_floor(evalue
*needle
) const {
82 for (int i
= 0; i
< floors
.size(); ++i
)
83 if (eequal(needle
, floors
[i
]->e
))
87 //void print(FILE *out, char **p);
88 void print_constraints(std::ostream
& os
, char **p
,
89 barvinok_options
*options
) const;
91 for (int i
= 0; i
< floors
.size(); ++i
)
92 EDomain_floor::unref(floors
[i
]);
98 unsigned dimension() const {
99 return D
->Dimension
- floors
.size();
101 bool contains(Value
*point
, int len
) const;
103 ge_constraint
*compute_ge_constraint(evalue
*constraint
) const;
104 void substitute(evalue
**sub
, Matrix
*T
, Matrix
*Eq
, unsigned MaxRays
);
105 bool not_empty(lexmin_options
*options
);
108 int evalue2constraint(EDomain
*D
, evalue
*E
, Value
*cons
, int len
);