43 template<
class I,
class J>
79 template<
class I,
class J>
93 template<
class I,
class J>
102 template<
class I,
class J>
122 template<
class I,
class J>
129 if (!
i() || (
j() && (
j.max()+1 <
i.min()))) {
130 mi =
j.min();
ma =
j.max(); ++
j;
return;
132 if (!
j() || (
i() && (
i.max()+1 <
j.min()))) {
133 mi =
i.min();
ma =
i.max(); ++
i;
return;
136 mi = std::min(
i.min(),
j.min());
137 ma = std::max(
i.max(),
j.max());
142 if (
i() && (
i.min() <=
ma+1)) {
143 ma = std::max(
ma,
i.max()); ++
i;
146 if (
j() && (
j.min() <=
ma+1)) {
147 ma = std::max(
ma,
j.max()); ++
j;
153 template<
class I,
class J>
157 template<
class I,
class J>
164 template<
class I,
class J>
178 template<
class I,
class J>
185 if (i.max()+1 < j.min()) {
188 }
else if (j.max()+1 < i.min()) {
192 int min = std::min(i.min(),j.min());
193 int max = std::max(i.max(),j.max());
197 if (i() && (i.min() <=
max+1)) {
198 max = std::max(
max,i.max()); ++i;
201 if (j() && (j.min() <=
max+1)) {
202 max = std::max(
max,j.max()); ++j;
227 while ((*
c != NULL) && i())
228 if ((*c)->max+1 < i.min()) {
231 }
else if (i.max()+1 < (*c)->min) {
239 (*c)->min = std::min((*c)->min,i.min());
241 int max = std::max((*c)->max,i.max());
248 if ((s != NULL) && (s->
min <=
max+1)) {
256 if (i() && (i.min() <=
max+1)) {
257 max = std::max(
max,i.max()); ++i;
261 (*c)->max =
max; (*c)->next = s;
286 template<
class I,
class J>
301 while ((m < n) && !i[m]())
330 template<
class I,
class J>
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 union of iterators.
RangeList * f
Freelist used for allocation.
NaryUnion & operator=(const NaryUnion &m)
Assignment operator (both iterators must be allocated from the same region)
void insert(I &i, RangeList *&u)
Insert ranges from i into u.
RangeList * two(I &i, J &j)
Return range list for union of two iterators.
NaryUnion(void)
Default constructor.
void operator|=(I &i)
Add iterator i.
void init(Region &r, I &i)
Initialize with single 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.
Union(void)
Default constructor.
void operator++(void)
Move iterator to next range (if possible)
void init(I &i, J &j)
Initialize with iterator i and j.
Range and value iterators.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r