Go to the documentation of this file.
36 namespace Gecode {
namespace Set {
namespace Element {
38 template<
class SView,
class RView>
49 template<
class SView,
class RView>
58 template<
class SView,
class RView>
72 template<
class SView,
class RView>
78 template<
class SView,
class RView>
85 template<
class SView,
class RView>
94 template<
class SView,
class RView>
100 template<
class SView,
class RView>
107 bool fix_flag =
false;
114 for(
int i=0; vx1lb(); ++vx1lb) {
115 while (iv[
i].idx < vx1lb.
val())
i++;
127 if (iv[
i].idx < vx1ub.
val()) {
139 for (
int k=
i; k<
n; k++) {
154 while (iv[
i].idx < vx1u.
val()) {
158 assert(iv[
i].idx == vx1u.
val());
160 SView candidate = iv[
i].view;
161 int candidateInd = iv[
i].idx;
168 ModEvent me = x1.exclude(home,candidateInd);
185 for (
int k=
i; k<
n; k++) {
193 if (x1.cardMax()==0) {
204 for (; vx1lb(); ++vx1lb) {
205 while (iv[
i].idx < vx1lb.
val())
i++;
206 assert(iv[
i].idx==vx1lb.
val());
209 for (
int j=0; vx1lb2(); ++vx1lb2) {
210 while (iv[j].idx < vx1lb2.
val()) j++;
211 assert(iv[j].idx==vx1lb2.
val());
212 if (iv[
i].idx!=iv[j].idx) {
214 ModEvent me = iv[j].view.excludeI(home,xilb);
225 if (x1.cardMin()-x1.glbSize() > 1) {
231 for (; vx1u() && x1.cardMin()-x1.glbSize() > 1; ++vx1u) {
233 while (iv[
i].idx < vx1u.
val())
i++;
234 assert(iv[
i].idx == vx1u.
val());
239 for (; vx1u2(); ++vx1u2) {
241 while (iv[j].idx < vx1u2.
val()) j++;
242 assert(iv[j].idx == vx1u2.
val());
243 if (iv[
i].idx!=iv[j].idx) {
256 ModEvent me = x1.exclude(home,iv[
i].idx);
271 for (; x1.cardMin()-x1.glbSize() == 2 && vx1u(); ++vx1u) {
273 while (iv[
i].idx < vx1u.
val())
i++;
274 assert (iv[
i].idx == vx1u.
val());
279 for (; vx1u2(); ++vx1u2) {
281 while (iv[j].idx < vx1u2.
val()) j++;
282 assert (iv[j].idx == vx1u2.
val());
283 if (iv[
i].idx!=iv[j].idx) {
286 for (; vx1u3(); ++vx1u3) {
288 while (iv[k].idx < vx1u3.
val()) k++;
289 assert (iv[k].idx == vx1u3.
val());
290 if (iv[j].idx!=iv[k].idx && iv[
i].idx!=iv[k].idx) {
305 ModEvent me = x1.include(home,iv[
i].idx);
312 for (
int i=iv.
size();
i--;)
313 if (!iv[
i].view.assigned())
Propagator for element with disjointness
ExecStatus ES_SUBSUMED(Propagator &p)
bool includeI(Space &home, I &i)
Include the set represented by i in this set.
void update(Space &home, IdxViewArray< View > &x)
Cloning.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Range iterator for the unknown set.
Base-class for both propagators and branchers.
ElementDisjoint(Space &home, ElementDisjoint &p)
Constructor for cloning p.
static PropCost quadratic(PropCost::Mod m, unsigned int n)
Quadratic complexity for modifier m and size measure n.
virtual void reschedule(Space &home)
Schedule function.
int val(void) const
Return current value.
Gecode toplevel namespace
Base-class for propagators.
Home class for posting propagators
Value iterator from range iterator.
Range iterator for computing intersection (binary)
Post propagator for SetVar SetOpType SetVar SetRelType r
Range iterator for the greatest lower bound.
int size(void) const
Return the current size.
int ModEvent
Type for modification events.
void dispose(Space &home)
Free memory used by this set.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
int size(void) const
Return size of array (number of elements)
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Propagation has computed fixpoint.
Range iterator for the least upper bound.
void subscribe(Space &home, Propagator &p, PropCond pc, bool process=true)
Range iterator for integer sets.
Growing sets of integers.
const Gecode::PropCond PC_SET_ANY
Propagate when any bound or the cardinality of a view changes.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Range iterator for singleton range.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
virtual size_t dispose(Space &home)
Delete actor and return its size.
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
int n
Number of negative literals for node type.
int ModEventDelta
Modification event deltas.
Gecode::IntArgs i({1, 2, 3, 4})
SetExpr inter(const SetVarArgs &x)
Intersection of set variables.
int p
Number of positive literals for node type.
static ExecStatus post(Home home, IdxViewArray &x, RView y)
Post propagator for .