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

Method propagate

gecode/int/nvalues/bool-lq.hpp:110–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108
109 template<class VY>
110 ExecStatus
111 LqBool<VY>::propagate(Space& home, const ModEventDelta&) {
112 if (status == (VS_ZERO | VS_ONE)) {
113 GECODE_ME_CHECK(y.gq(home,2));
114 return home.ES_SUBSUMED(*this);
115 }
116
117 if (c.empty()) {
118 assert((status != 0) && (y.min() >= 1));
119 return home.ES_SUBSUMED(*this);
120 }
121
122 if (y.max() == 1) {
123 if (status == VS_ZERO) {
124 // Mark that everything is done
125 status = VS_ZERO | VS_ONE;
126 for (Advisors<ViewAdvisor<BoolView> > as(c); as(); ++as)
127 GECODE_ME_CHECK(as.advisor().view().zero(home));
128 return home.ES_SUBSUMED(*this);
129 }
130 if (status == VS_ONE) {
131 // Mark that everything is done
132 status = VS_ZERO | VS_ONE;
133 for (Advisors<ViewAdvisor<BoolView> > as(c); as(); ++as)
134 GECODE_ME_CHECK(as.advisor().view().one(home));
135 return home.ES_SUBSUMED(*this);
136 }
137 }
138
139 if (y.min() == 2)
140 return home.ES_SUBSUMED(*this);
141
142 return ES_FIX;
143 }
144
145}}}
146

Callers

nothing calls this directly

Calls 8

ES_SUBSUMEDMethod · 0.80
gqMethod · 0.45
emptyMethod · 0.45
minMethod · 0.45
maxMethod · 0.45
zeroMethod · 0.45
viewMethod · 0.45
oneMethod · 0.45

Tested by

no test coverage detected