40 namespace Gecode {
namespace Iter {
namespace Ranges {
47 template<
class I,
class J>
62 void init(I& i, J& j);
91 template<
class I,
class J>
100 template<
class I,
class J>
107 void operator &=(I&
i);
120 template<
class I,
class J>
123 if (!
i() || !
j())
goto done;
125 while (
i() && (
i.max() <
j.min())) ++
i;
127 while (
j() && (
j.max() <
i.min())) ++
j;
129 }
while (
i.max() <
j.min());
133 if (
i.max() <
j.max()) ++
i;
else ++
j;
139 template<
class I,
class J>
143 template<
class I,
class J>
150 template<
class I,
class J>
174 template<
class I,
class J>
183 while (
i() && (i.max() < j.min())) ++
i;
185 while (
j() && (j.max() < i.min())) ++
j;
187 }
while (i.max() < j.min());
191 *c =
t; c = &t->
next;
192 if (i.max() < j.max()) ++i;
else ++
j;
204 if ((n > 0) && i[0]()) {
208 int min = i[0].min();
211 int max = i[0].max();
214 for (
int j=n;
j--;) {
216 while (i[
j]() && (i[
j].
max() < min))
220 if (i[
j].
min() > max) {
226 if (min < i[
j].
min())
228 if (max > i[
j].
max())
232 *c =
t; c = &t->
next;
247 template<
class I,
class J>
265 while (
i() && (j != NULL)) {
267 while (
i() && (i.max() < j->
min))
270 while ((j != NULL) && (j->
max < i.min())) {
275 if (j == NULL)
goto done;
276 }
while (i.max() < j->
min);
280 *c =
t; c = &t->
next;
281 if (i.max() < j->
max) {
const FloatNum max
Largest allowed float value.
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.
int min(void) const
Return smallest value of range.
Gecode::FloatVal c(-8, 8)
Inter(void)
Default constructor.
const FloatNum min
Smallest allowed float value.
int n
Number of negative literals for node type.
Range iterator for computing intersection (binary)
void finish(void)
Set range such that iteration stops
void range(Home home, const IntVarArgs &x, SetVar y, SetVar z)
Post constraint .
int min
Minimum and maximum of a range.
void init(Region &r, I &i)
Initialize with single iterator i.
NaryInter & operator=(const NaryInter &m)
Assignment operator (both iterators must be allocated from the same region)
NaryInter(void)
Default constructor.
RangeList * next
Next element.
int mi
Minimum of current range.
Range iterator for intersection of iterators.
void init(Region &r)
Initialize.
void init(I &i, J &j)
Initialize with iterator i and j.
Gecode toplevel namespace
void operator++(void)
Move iterator to next range (if possible)
Iterator over range lists.
int ma
Maximum of current range.
void operator&=(I &i)
Add iterator i.