43 template<
class I,
class J>
87 template<
class I,
class J>
98 template<
class I,
class J>
118 template<
class I,
class J>
121 if (!
i() || !
j())
goto done;
123 while (
i() && (
i.max() <
j.min())) ++
i;
125 while (
j() && (
j.max() <
i.min())) ++
j;
127 }
while (
i.max() <
j.min());
129 ma = std::min(
i.max(),
j.max());
130 mi = std::max(
i.min(),
j.min());
131 if (
i.max() <
j.max()) ++
i;
else ++
j;
137 template<
class I,
class J>
141 template<
class I,
class J>
148 template<
class I,
class J>
172 template<
class I,
class J>
181 while (i() && (i.max() < j.min())) ++i;
183 while (j() && (j.max() < i.min())) ++j;
185 }
while (i.max() < j.min());
188 std::min(i.max(),j.max()));
190 if (i.max() < j.max()) ++i;
else ++j;
202 if ((n > 0) && i[0]()) {
206 int min = i[0].min();
209 int max = i[0].max();
212 for (
int j=n; j--;) {
214 while (i[j]() && (i[j].
max() <
min))
245 template<
class I,
class J>
263 while (i() && (j !=
nullptr)) {
265 while (i() && (i.max() < j->
min))
268 while ((j !=
nullptr) && (j->
max < i.min())) {
273 if (j ==
nullptr)
goto done;
274 }
while (i.max() < j->
min);
277 std::min(i.max(),j->
max),
f);
279 if (i.max() < j->
max) {
289 while (j !=
nullptr) {
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.
int ma
Maximum of current range.
int mi
Minimum of current range.
MinMax(void)
Default constructor.
void finish(void)
Set range such that iteration stops
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.
NaryInter(const NaryInter &)=default
Copy 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.
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(void)
Default constructor.
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.
Range and value iterators.
Gecode toplevel namespace