40 namespace Gecode {
namespace Set {
namespace Element {
42 template<
class SView,
class RView>
53 template<
class SView,
class RView>
58 x1.update(home,share,p.
x1);
62 template<
class SView,
class RView>
76 template<
class SView,
class RView>
82 template<
class SView,
class RView>
91 template<
class SView,
class RView>
97 template<
class SView,
class RView>
104 bool fix_flag =
false;
111 for(
int i=0; vx1lb(); ++vx1lb) {
112 while (iv[
i].idx < vx1lb.
val())
i++;
124 if (iv[i].idx < vx1ub.
val()) {
136 for (
int k=i; k<
n; k++) {
151 while (iv[i].idx < vx1u.
val()) {
155 assert(iv[i].idx == vx1u.
val());
157 SView candidate = iv[
i].view;
158 int candidateInd = iv[
i].idx;
165 ModEvent me = x1.exclude(home,candidateInd);
182 for (
int k=i; k<
n; k++) {
190 if (x1.cardMax()==0) {
201 for (; vx1lb(); ++vx1lb) {
202 while (iv[i].idx < vx1lb.
val()) i++;
203 assert(iv[i].idx==vx1lb.
val());
206 for (
int j=0; vx1lb2(); ++vx1lb2) {
207 while (iv[j].idx < vx1lb2.
val()) j++;
208 assert(iv[j].idx==vx1lb2.
val());
209 if (iv[i].idx!=iv[j].idx) {
211 ModEvent me = iv[j].view.excludeI(home,xilb);
222 if (x1.cardMin()-x1.glbSize() > 1) {
228 for (; vx1u() && x1.cardMin()-x1.glbSize() > 1; ++vx1u) {
230 while (iv[i].idx < vx1u.
val()) i++;
231 assert(iv[i].idx == vx1u.
val());
236 for (; vx1u2(); ++vx1u2) {
238 while (iv[j].idx < vx1u2.
val()) j++;
239 assert(iv[j].idx == vx1u2.
val());
240 if (iv[i].idx!=iv[j].idx) {
253 ModEvent me = x1.exclude(home,iv[i].idx);
268 for (; x1.cardMin()-x1.glbSize() == 2 && vx1u(); ++vx1u) {
270 while (iv[i].idx < vx1u.
val()) i++;
271 assert (iv[i].idx == vx1u.
val());
276 for (; vx1u2(); ++vx1u2) {
278 while (iv[j].idx < vx1u2.
val()) j++;
279 assert (iv[j].idx == vx1u2.
val());
280 if (iv[i].idx!=iv[j].idx) {
283 for (; vx1u3(); ++vx1u3) {
285 while (iv[k].idx < vx1u3.
val()) k++;
286 assert (iv[k].idx == vx1u3.
val());
287 if (iv[j].idx!=iv[k].idx && iv[i].idx!=iv[k].idx) {
302 ModEvent me = x1.include(home,iv[i].idx);
309 bool allAssigned =
true;
310 for (
int i=iv.
size();
i--;)
311 if (!iv[
i].view.assigned()) {
virtual Actor * copy(Space &home, bool)
Copy propagator during cloning.
static PropCost quadratic(PropCost::Mod m, unsigned int n)
Quadratic complexity for modifier m and size measure n.
Range iterator for the unknown set.
Range iterator for singleton range.
ExecStatus ES_SUBSUMED(Propagator &p)
int size(void) const
Return size of array (number of elements)
void subscribe(Space &home, Propagator &p, PropCond pc, bool process=true)
int ModEvent
Type for modification events.
Base-class for propagators.
Range iterator for the greatest lower bound.
Propagator for element with disjointness
Propagation has computed fixpoint.
Range iterator for the least upper bound.
Base-class for both propagators and branchers.
void update(Space &home, bool share, IdxViewArray< View > &x)
Cloning.
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.
Range iterator for computing intersection (binary)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Value iterator from range iterator.
Range iterator for integer sets.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
bool includeI(Space &home, I &i)
Include the set represented by i in this set.
void dispose(Space &home)
Free memory used by this set.
static ExecStatus post(Home home, IdxViewArray &x, RView y)
Post propagator for .
const Gecode::PropCond PC_SET_ANY
Propagate when any bound or the cardinality of a view changes.
SetExpr inter(const SetVarArgs &x)
Intersection of set variables.
virtual size_t dispose(Space &home)
Delete actor and return its size.
int size(void) const
Return the current size.
Growing sets of integers.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
int val(void) const
Return current value.
int ModEventDelta
Modification event deltas.
Home class for posting propagators
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
ElementDisjoint(Space &home, bool share, ElementDisjoint &p)
Constructor for cloning p.