38 namespace Gecode {
namespace Int {
40 template<
class View,
class A>
43 rp = rp_fst;
v = rp->min;
44 max = rp->min +
static_cast<int>((rp+1)->
pos - rp->pos) - 1;
47 template<
class View,
class A>
50 :
a(a0),
x(x0), bs(
a,
x.
size(),true) {
54 rp_fst = a.template alloc<RangePos>(n+1);
59 rp_fst[
i].min =
r.min();
67 template<
class View,
class A>
71 a.free(rp_fst,static_cast<unsigned long int>(rp_lst-rp_fst+1));
74 template<
class View,
class A>
80 max = rp->min +
static_cast<int>((rp+1)->
pos - rp->pos) - 1;
84 template<
class View,
class A>
90 template<
class View,
class A>
96 template<
class View,
class A>
99 bs.clear(rp->pos + static_cast<unsigned int>(
v-rp->min));
102 template<
class View,
class A>
105 RangePos*
l = rp_fst;
106 RangePos*
r = rp_lst-1;
108 if (l > r)
return false;
109 RangePos* m = l + (r-
l)/2;
110 int max = m->min +
static_cast<int>((m+1)->
pos - m->pos) - 1;
111 if ((n >= m->min) && (n <=
max)) {
112 bs.clear(m->pos + static_cast<unsigned int>(n-m->min));
115 if (l == r)
return false;
125 template<
class View,
class A>
128 if ((n <
x.min()) || (n >
x.max()))
133 template<
class View,
class A>
136 if ((n <
x.min()) || (n >
x.max()))
138 return _support(static_cast<int>(n));
141 template<
class View,
class A>
145 while ((
p < sv.x.size()) && !sv.bs.get(
p))
148 while ((rp < sv.rp_lst) && (
p >= (rp+1)->pos))
152 template<
class View,
class A>
155 : rp(sv0.rp_fst),
p(0), sv(sv0) {
159 template<
class View,
class A>
161 SupportValues<View,A>::Unsupported::operator ++(
void) {
165 template<
class View,
class A>
167 SupportValues<View,A>::Unsupported::operator ()(
void)
const {
168 return rp < sv.rp_lst;
171 template<
class View,
class A>
173 SupportValues<View,A>::Unsupported::val(
void)
const {
174 return static_cast<int>(rp->min+(
p-rp->pos));
177 template<
class View,
class A>
180 Unsupported
u(*
this);
181 return x.minus_v(home,u,
false);
ModEvent tell(Space &home)
Remove all unsupported values.
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.
int val(void) const
Return current value.
SupportValues(A &a, View x)
Initialize for view x.
Range iterator for integer views.
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
void reset(void)
Reset iterator.
unsigned int size(I &i)
Size of all ranges of range iterator i.
union Gecode::@518::NNF::@57 u
Union depending on nodetype t.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void support(void)
Mark current (iterator) value as supported.
Node * x
Pointer to corresponding Boolean expression node.
bool operator()(void) const
Test whether iterator is still at a value or done.
Gecode toplevel namespace
#define GECODE_NEVER
Assert that this command is never executed.
Support value iterator and recorder
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.