36 namespace Gecode {
namespace Iter {
namespace Ranges {
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;
142 if (
i() && (
i.min() <= ma+1)) {
146 if (j() && (j.min() <= ma+1)) {
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()) {
187 *
c =
t;
c = &
t->next;
188 }
else if (j.max()+1 <
i.min()) {
190 *
c =
t;
c = &
t->next;
197 if (
i() && (
i.min() <=
max+1)) {
201 if (j() && (j.min() <=
max+1)) {
207 *
c =
t;
c = &
t->next;
211 *
c =
t;
c = &
t->next;
215 *
c =
t;
c = &
t->next;
227 while ((*
c != NULL) &&
i())
228 if ((*c)->max+1 <
i.min()) {
231 }
else if (
i.max()+1 < (*c)->min) {
235 t->next = *
c; *
c =
t;
c = &
t->next;
248 if ((s != NULL) && (s->
min <=
max+1)) {
256 if (
i() && (
i.min() <=
max+1)) {
261 (*c)->max =
max; (*c)->next = s;
267 *
c =
t;
c = &
t->next;
286 template<
class I,
class J>
301 while ((m <
n) && !
i[m]())
330 template<
class I,
class J>
union Gecode::@602::NNF::@65 u
Union depending on nodetype t.
int n
Number of negative literals for node type.
Base for range iterators with explicit min and max.
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.
NaryUnion(void)
Default constructor.
void operator|=(I &i)
Add iterator i.
void init(Region &r, I &i)
Initialize with single iterator i.
RangeList * two(I &i, J &j)
Return range list for union of two iterators.
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.
Range iterator for computing union (binary)
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.
const FloatNum max
Largest allowed float value.
const FloatNum min
Smallest allowed float value.
Gecode::IntArgs i({1, 2, 3, 4})