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

Method propagate

gecode/int/nvalues/int-eq.hpp:115–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113
114 template<class VY>
115 ExecStatus
116 EqInt<VY>::propagate(Space& home, const ModEventDelta& med) {
117 // Add assigned views to value set
118 if (IntView::me(med) == ME_INT_VAL)
119 add(home);
120
121 GECODE_ME_CHECK(y.gq(home, vs.size()));
122 GECODE_ME_CHECK(y.lq(home, x.size() + vs.size()));
123
124 if (x.size() == 0)
125 return home.ES_SUBSUMED(*this);
126
127 // All values must be in the value set
128 if (y.max() == vs.size())
129 return all_in_valset(home);
130
131 // Compute positions of disjoint views and eliminate subsumed views
132 Region r;
133 int* dis; int n_dis;
134 disjoint(home,r,dis,n_dis);
135
136 // The number might have changed due to elimination of subsumed views
137 GECODE_ME_CHECK(y.lq(home, x.size() + vs.size()));
138
139 if (x.size() == 0) {
140 assert(y.val() == vs.size());
141 return home.ES_SUBSUMED(*this);
142 }
143
144 GECODE_ES_CHECK(prune_upper(home,g));
145
146 // No lower bound pruning possible
147 if (n_dis == 0)
148 return ES_NOFIX;
149
150 // Only if the propagator is at fixpoint here, continue with
151 // propagating the lower bound
152 if (IntView::me(Propagator::modeventdelta()) != ME_INT_NONE)
153 return ES_NOFIX;
154
155 // Do lower bound-based pruning
156 GECODE_ES_CHECK(prune_lower(home,dis,n_dis));
157
158 return ES_NOFIX;
159 }
160
161}}}
162

Callers

nothing calls this directly

Calls 8

addFunction · 0.85
disjointFunction · 0.85
ES_SUBSUMEDMethod · 0.80
gqMethod · 0.45
sizeMethod · 0.45
lqMethod · 0.45
maxMethod · 0.45
valMethod · 0.45

Tested by

no test coverage detected