36namespace Gecode {
namespace Iter {
namespace Ranges {
43 template<
class I,
class J>
87 template<
class I,
class J>
96 template<
class I,
class J>
116 template<
class I,
class J>
119 if (!i() || !j())
goto done;
121 while (i() && (i.max() < j.min())) ++i;
123 while (j() && (j.max() < i.min())) ++j;
125 }
while (i.max() < j.min());
127 ma = std::min(i.max(),j.max());
128 mi = std::max(i.min(),j.min());
129 if (i.max() < j.max()) ++i;
else ++j;
135 template<
class I,
class J>
139 template<
class I,
class J>
146 template<
class I,
class J>
170 template<
class I,
class J>
179 while (i() && (i.max() < j.min())) ++i;
181 while (j() && (j.max() < i.min())) ++j;
183 }
while (i.max() < j.min());
186 std::min(i.max(),j.max()));
188 if (i.max() < j.max()) ++i;
else ++j;
200 if ((
n > 0) && i[0]()) {
204 int min = i[0].min();
207 int max = i[0].max();
210 for (
int j=
n; j--;) {
212 while (i[j]() && (i[j].
max() <
min))
243 template<
class I,
class J>
261 while (i() && (j != NULL)) {
263 while (i() && (i.max() < j->
min))
266 while ((j != NULL) && (j->
max < i.min())) {
271 if (j == NULL)
goto done;
272 }
while (i.max() < j->
min);
275 std::min(i.max(),j->
max),
f);
277 if (i.max() < j->
max) {
int n
Number of negative literals for node type.
Range iterator for computing intersection (binary)
void operator++(void)
Move iterator to next range (if possible)
void init(I &i, J &j)
Initialize with iterator i and j.
Inter(void)
Default constructor.
Base for range iterators with explicit min and max.
Range iterator for intersection of iterators.
NaryInter & operator=(const NaryInter &m)
Assignment operator (both iterators must be allocated from the same region)
NaryInter(void)
Default constructor.
void init(Region &r, I &i)
Initialize with single iterator i.
void operator&=(I &i)
Add iterator i.
int min
Minimum and maximum of a range.
RangeList * next
Next element.
Iterator over range lists.
RangeList * copy(I &i)
Copy the iterator i to a range list.
int max(void) const
Return largest value of range.
RangeList * get(void) const
Get head of current range list.
void init(Region &r)
Initialize.
RangeListIter & operator=(const RangeListIter &i)
Assignment operator.
RangeList * range(int min, int max, RangeList *&f)
Create new range possibly from freelist f and init.
void set(RangeList *l)
Set range lists.
RangeList * c
Current list element.
RangeList * h
Head of range list.
int min(void) const
Return smallest value of range.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r