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

Method propagate

gecode/int/nvalues/bool-gq.hpp:108–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 9

aFunction · 0.85
ES_SUBSUMEDMethod · 0.80
emptyMethod · 0.45
lqMethod · 0.45
maxMethod · 0.45
minMethod · 0.45
oneMethod · 0.45
viewMethod · 0.45
zeroMethod · 0.45

Tested by

no test coverage detected