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>
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) {
RangeList * range(int min, int max, RangeList *&f)
Create new range possibly from freelist f and init.
const FloatNum max
Largest allowed float value.
int min(void) const
Return smallest value of range.
Base for range iterators with explicit min and max.
RangeListIter & operator=(const RangeListIter &i)
Assignment operator.
Inter(void)
Default constructor.
const FloatNum min
Smallest allowed float value.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
Range iterator for computing intersection (binary)
RangeList * copy(I &i)
Copy the iterator i to a range list.
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.
Range iterator for intersection of iterators.
void set(RangeList *l)
Set range lists.
void init(Region &r)
Initialize.
void init(I &i, J &j)
Initialize with iterator i and j.
int max(void) const
Return largest value of range.
Gecode toplevel namespace
void operator++(void)
Move iterator to next range (if possible)
RangeList * h
Head of range list.
Iterator over range lists.
RangeList * c
Current list element.
void operator&=(I &i)
Add iterator i.