4 #include <barvinok/evalue.h>
5 #include <barvinok/options.h>
9 bool substituted
; // see substitute method
12 /* first element is denominator */
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;
31 void substitute(evalue
**sub
, Matrix
*T
);
36 struct ge_constraint
{
37 const EDomain
* const D
;
39 std::vector
<EDomain_floor
*> new_floors
;
42 ge_constraint(const EDomain
*const D
) : D(D
) {}
44 for (int i
= 0; i
< new_floors
.size(); ++i
)
45 EDomain_floor::unref(new_floors
[i
]);
53 std::vector
<EDomain_floor
*> floors
;
55 EDomain(Polyhedron
*D
) {
56 this->D
= Polyhedron_Copy(D
);
59 EDomain(Polyhedron
*D
, std::vector
<EDomain_floor
*>floors
) {
60 this->D
= Polyhedron_Copy(D
);
64 EDomain(EDomain
*ED
) {
65 this->D
= Polyhedron_Copy(ED
->D
);
66 add_floors(ED
->floors
);
69 static EDomain
*new_from_ge_constraint(ge_constraint
*ge
, int sign
,
70 barvinok_options
*options
);
71 EDomain(Polyhedron
*D
, const EDomain
*const ED
,
72 std::vector
<EDomain_floor
*>floors
) {
73 this->D
= Polyhedron_Copy(D
);
74 add_floors(ED
->floors
);
78 void add_floors(std::vector
<EDomain_floor
*>floors
) {
79 for (int i
= 0; i
< floors
.size(); ++i
)
80 this->floors
.push_back(floors
[i
]->ref());
82 int find_floor(evalue
*needle
) const {
83 for (int i
= 0; i
< floors
.size(); ++i
)
84 if (eequal(needle
, floors
[i
]->e
))
88 //void print(FILE *out, char **p);
89 void print_constraints(std::ostream
& os
, char **p
,
90 barvinok_options
*options
) const;
92 for (int i
= 0; i
< floors
.size(); ++i
)
93 EDomain_floor::unref(floors
[i
]);
99 unsigned dimension() const {
100 return D
->Dimension
- floors
.size();
102 bool contains(Value
*point
, int len
) const;
104 ge_constraint
*compute_ge_constraint(evalue
*constraint
) const;
105 void substitute(evalue
**sub
, Matrix
*T
, Matrix
*Eq
, unsigned MaxRays
);
106 bool not_empty(lexmin_options
*options
);
109 int evalue2constraint(EDomain
*D
, evalue
*E
, Value
*cons
, int len
);