40 namespace Gecode {
namespace Iter {
namespace Ranges {
47 template<
class I,
class 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))
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) {
303 return static_cast<NaryInter&>(RangeListIter::operator =(m));
RangeList * range(int min, int max, RangeList *&f)
Create new range possibly from freelist f and init.
const FloatNum max
Largest allowed float value.
Base for range iterators with explicit min and max.
int max(void) const
Return largest value of range.
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.
void operator &=(I &i)
Add iterator i.
int min(void) const
Return smallest value of range.
NaryInter & operator=(const NaryInter &m)
Assignment operator (both iterators must be allocated from the same region)
NaryInter(void)
Default constructor.
Post propagator for SetVar SetOpType SetVar SetRelType r
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.
RangeList * get(void) const
Get head of current range list.
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.