36 namespace Gecode {
namespace Iter {
namespace Ranges {
43 template<
class I,
class J>
58 void init(I& i, J& j);
79 template<
class I,
class J>
93 template<
class I,
class J>
102 template<
class I,
class J>
109 void operator |=(I&
i);
122 template<
class I,
class J>
129 if (!
i() || (
j() && (
j.max()+1 <
i.min()))) {
130 mi =
j.min();
ma =
j.max(); ++
j;
return;
132 if (!
j() || (
i() && (
i.max()+1 <
j.min()))) {
133 mi =
i.min();
ma =
i.max(); ++
i;
return;
142 if (
i() && (i.min() <= ma+1)) {
146 if (
j() && (
j.min() <= ma+1)) {
153 template<
class I,
class J>
157 template<
class I,
class J>
164 template<
class I,
class J>
178 template<
class I,
class J>
185 if (i.max()+1 < j.min()) {
187 *c =
t; c = &t->
next;
188 }
else if (j.max()+1 < i.min()) {
190 *c =
t; c = &t->
next;
197 if (
i() && (i.min() <= max+1)) {
201 if (
j() && (j.min() <= max+1)) {
207 *c =
t; c = &t->
next;
211 *c =
t; c = &t->
next;
215 *c =
t; c = &t->
next;
227 while ((*c != NULL) &&
i())
228 if ((*c)->max+1 < i.min()) {
231 }
else if (i.max()+1 < (*c)->min) {
248 if ((s != NULL) && (s->min <= max+1)) {
256 if (
i() && (i.min() <= max+1)) {
261 (*c)->max =
max; (*c)->next = s;
267 *c =
t; c = &t->
next;
286 template<
class I,
class J>
301 while ((m < n) && !i[m]())
330 template<
class I,
class J>
const FloatNum max
Largest allowed float value.
void operator|=(I &i)
Add iterator i.
void init(Region &r, I &i)
Initialize with single iterator i.
int max(void) const
Return largest value of range.
Base for range iterators with explicit min and max.
RangeListIter & operator=(const RangeListIter &i)
Assignment operator.
NaryUnion(void)
Default constructor.
void init(I &i, J &j)
Initialize with iterator i and j.
Gecode::FloatVal c(-8, 8)
const FloatNum min
Smallest allowed float value.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
NaryUnion & operator=(const NaryUnion &m)
Assignment operator (both iterators must be allocated from the same region)
void finish(void)
Set range such that iteration stops
Range iterator for union of iterators.
void range(Home home, const IntVarArgs &x, SetVar y, SetVar z)
Post constraint .
RangeList * copy(I &i)
Copy the iterator i to a range list.
union Gecode::@585::NNF::@62 u
Union depending on nodetype t.
int min
Minimum and maximum of a range.
Range iterator for computing union (binary)
Post propagator for SetVar SetOpType SetVar SetRelType r
RangeList * next
Next element.
Post propagator for f(x \diamond_{\mathit{op}} y) \sim_r z \f$ void rel(Home home
int mi
Minimum of current range.
void init(Region &r)
Initialize.
void operator++(void)
Move iterator to next range (if possible)
RangeList * two(I &i, J &j)
Return range list for union of two iterators.
void insert(I &i, RangeList *&u)
Insert ranges from i into u.
Gecode toplevel namespace
Union(void)
Default constructor.
int min(void) const
Return smallest value of range.
Iterator over range lists.
int ma
Maximum of current range.
RangeList * f
Freelist used for allocation.