34 namespace Gecode {
namespace Int {
36 template<
class View,
class A>
39 rp = rp_fst;
v = rp->min;
40 max = rp->min +
static_cast<int>((rp+1)->
pos - rp->pos) - 1;
43 template<
class View,
class A>
46 :
a(a0),
x(x0), bs(
a,
x.
size(),true) {
50 rp_fst = a.template alloc<RangePos>(n+1);
55 rp_fst[
i].min =
r.min();
63 template<
class View,
class A>
67 a.free(rp_fst,static_cast<unsigned long int>(rp_lst-rp_fst+1));
70 template<
class View,
class A>
76 max = rp->min +
static_cast<int>((rp+1)->
pos - rp->pos) - 1;
80 template<
class View,
class A>
86 template<
class View,
class A>
92 template<
class View,
class A>
95 bs.
clear(rp->pos + static_cast<unsigned int>(v-rp->min));
98 template<
class View,
class A>
101 RangePos*
l = rp_fst;
102 RangePos*
r = rp_lst-1;
104 if (l > r)
return false;
105 RangePos* m = l + (r-
l)/2;
106 int max = m->min +
static_cast<int>((m+1)->
pos - m->pos) - 1;
107 if ((n >= m->min) && (n <= max)) {
108 bs.
clear(m->pos + static_cast<unsigned int>(n-m->min));
111 if (l == r)
return false;
121 template<
class View,
class A>
124 if ((n < x.min()) || (n > x.max()))
129 template<
class View,
class A>
132 if ((n < x.min()) || (n > x.max()))
134 return _support(static_cast<int>(n));
137 template<
class View,
class A>
141 while ((
p < sv.x.size()) && !sv.bs.get(
p))
144 while ((rp < sv.rp_lst) && (
p >= (rp+1)->pos))
148 template<
class View,
class A>
151 : rp(sv0.rp_fst),
p(0), sv(sv0) {
155 template<
class View,
class A>
161 template<
class View,
class A>
164 return rp < sv.rp_lst;
167 template<
class View,
class A>
170 return static_cast<int>(rp->min+(
p-rp->pos));
173 template<
class View,
class A>
176 Unsupported
u(*
this);
177 return x.minus_v(home,u,
false);
ModEvent tell(Space &home)
Remove all unsupported values.
void clear(unsigned int i)
Clear bit i.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
bool pos(const View &x)
Test whether x is postive.
~SupportValues(void)
Destructor.
void operator++(void)
Move iterator to next value (if possible)
int ModEvent
Type for modification events.
SupportValues(A &a, View x)
Initialize for view x.
Range iterator for integer views.
void dispose(A &a)
Dispose memory for bit set.
bool operator()(void) const
Test whether iterator is still at a value or done.
int p
Number of positive literals for node type.
int n
Number of negative literals for node type.
Gecode::IntArgs i({1, 2, 3, 4})
void reset(void)
Reset iterator.
unsigned int size(I &i)
Size of all ranges of range iterator i.
union Gecode::@593::NNF::@62 u
Union depending on nodetype t.
Post propagator for SetVar SetOpType SetVar SetRelType r
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void support(void)
Mark current (iterator) value as supported.
Post propagator for SetVar x
int val(void) const
Return current value.
Gecode toplevel namespace
#define GECODE_NEVER
Assert that this command is never executed.
Support value iterator and recorder
struct Gecode::@593::NNF::@62::@64 a
For atomic nodes.