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>
157 SupportValues<View,A>::Unsupported::operator ++(
void) {
161 template<
class View,
class A>
163 SupportValues<View,A>::Unsupported::operator ()(
void)
const {
164 return rp < sv.rp_lst;
167 template<
class View,
class A>
169 SupportValues<View,A>::Unsupported::val(
void)
const {
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);