40 namespace Gecode {
namespace Set {
namespace Element {
42 template<
class View,
class View0,
class View1>
53 template<
class View,
class View0,
class View1>
58 x0.update(home,share,p.
x0);
59 x1.update(home,share,p.
x1);
63 template<
class View,
class View0,
class View1>
70 template<
class View,
class View0,
class View1>
83 template<
class View,
class View0,
class View1>
97 template<
class View,
class View0,
class View1>
103 template<
class View,
class View0,
class View1>
137 unsigned int maxCard = 0;
143 if (iv[i].idx < vx0ub.
val()) {
148 assert(iv[i].idx == vx0ub.
val());
151 View candidate = iv[j].view;
152 int candidateInd = iv[j].idx;
160 bool selectSingleInconsistent =
false;
161 if (x0.cardMax() <= 1) {
166 selectSingleInconsistent =
167 diff2() || candidate.cardMax() < x1.cardMin();
178 if (selectSingleInconsistent ||
179 candidate.cardMin() > x1.cardMax() ||
181 ModEvent me = (x0.exclude(home,candidateInd));
192 if (vx0() && vx0.
val()==candidateInd) {
195 ModEvent me = x1.includeI(home,candlb);
200 me = candidate.intersectI(home,x1ub);
206 before[j].
update(home,sofarBefore);
211 maxCard =
std::max(maxCard, candidate.cardMax());
212 minCard =
std::min(minCard, candidate.cardMin());
221 for (
int k=i; k<n; k++) {
227 if (x0.cardMax()==0) {
233 before[i].dispose(home);
237 if (x0.cardMin() > 0) {
241 ModEvent me = x1.includeI(home, si);
244 me = x1.cardMin(home, minCard);
250 if (x0.cardMax() <= 1) {
251 ModEvent me = x1.cardMax(home, maxCard);
259 ModEvent me = x1.intersectI(home,sfB);
270 for (
int i=n; i--;) {
282 ModEvent me = (x0.include(home,iv[i].idx));
287 me = iv[
i].view.includeI(home,diff);
301 if (x0.assigned() && !x1.assigned()) {
302 int ubsize =
static_cast<int>(x0.lubSize());
309 ::
post(home(*
this),is,x1)));
310 }
else if (ubsize == 2) {
315 ::
post(home(*
this),a,b,x1)));
316 }
else if (ubsize == 1) {
326 bool allAssigned =
true;
327 for (
int i=iv.
size();
i--;) {
328 if (!iv[
i].view.assigned()) {
333 if (x1.assigned() && x0.assigned() && allAssigned) {