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) {
284 RangeList* tn = j->next;
292 RangeList*
t = j->next;
RangeList * range(int min, int max, RangeList *&f)
Create new range possibly from freelist f and init.
const FloatNum max
Largest allowed float value.
Range iterator for range lists
Base for range iterators with explicit min and max.
RangeListIter & operator=(const RangeListIter &i)
Assignment operator.
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.
void init(Region &r, I &i)
Initialize with single 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
Range iterator for intersection of iterators.
void operator&=(I &i)
Add iterator i.
void init(Region &r)
Initialize.
void init(I &i, J &j)
Initialize with iterator i and j.
Lists of ranges (intervals)
int max(void) const
Return largest value of range.
Gecode toplevel namespace
int min(void) const
Return smallest value of range.
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.