MCPcopy Create free account
hub / github.com/Gecode/gecode / propagate

Method propagate

gecode/int/distinct/dom.hpp:95–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93
94 template<class View>
95 ExecStatus
96 Dom<View>::propagate(Space& home, const ModEventDelta& med) {
97 if (View::me(med) == ME_INT_VAL) {
98 ExecStatus es = prop_val<View,false>(home,x);
99 GECODE_ES_CHECK(es);
100 if (x.size() < 2)
101 return home.ES_SUBSUMED(*this);
102 if (es == ES_FIX)
103 return home.ES_FIX_PARTIAL(*this,View::med(ME_INT_DOM));
104 es = prop_bnd<View>(home,x);
105 GECODE_ES_CHECK(es);
106 if (x.size() < 2)
107 return home.ES_SUBSUMED(*this);
108 es = prop_val<View,true>(home,x);
109 GECODE_ES_CHECK(es);
110 if (x.size() < 2)
111 return home.ES_SUBSUMED(*this);
112 return home.ES_FIX_PARTIAL(*this,View::med(ME_INT_DOM));
113 }
114
115 if (x.size() == 2)
116 GECODE_REWRITE(*this,(Rel::Nq<View,View>::post(home(*this),x[0],x[1])));
117 if (x.size() == 3)
118 GECODE_REWRITE(*this,TerDom<View>::post(home(*this),x[0],x[1],x[2]));
119
120 if (dc.available()) {
121 GECODE_ES_CHECK(dc.sync());
122 } else {
123 GECODE_ES_CHECK(dc.init(home,x));
124 }
125
126 bool assigned;
127 GECODE_ES_CHECK(dc.propagate(home,assigned));
128
129 return ES_FIX;
130 }
131
132}}}
133

Callers

nothing calls this directly

Calls 7

ES_SUBSUMEDMethod · 0.80
ES_FIX_PARTIALMethod · 0.80
availableMethod · 0.80
postFunction · 0.50
sizeMethod · 0.45
syncMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected