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);