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

Method propagate

gecode/set/channel/int.hpp:120–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118
119 template<class View>
120 ExecStatus
121 ChannelInt<View>::propagate(Space& home, const ModEventDelta&) {
122 int assigned = 0;
123 for (int v=xs.size(); v--;) {
124 if (xs[v].assigned()) {
125 assigned++;
126 if (xs[v].modified())
127 GECODE_ME_CHECK(ys[xs[v].val()].include(home,v));
128 }
129 if (xs[v].modified()) {
130 Gecode::Int::ViewDiffRanges<Gecode::Int::IntView> d(xs[v]);
131 Iter::Ranges::ToValues<Gecode::Int::ViewDiffRanges<
132 Gecode::Int::IntView> > dv(d);
133 for (; dv(); ++dv)
134 GECODE_ME_CHECK(ys[dv.val()].exclude(home, v));
135 xs[v].cache(home);
136 }
137 }
138
139 for (int i=ys.size(); i--;) {
140 if (ys[i].glbModified()) {
141 GlbDiffRanges<View> yilb(ys[i]);
142 Iter::Ranges::ToValues<GlbDiffRanges<View> > dv(yilb);
143 for (;dv();++dv)
144 GECODE_ME_CHECK(xs[dv.val()].eq(home,i));
145 ys[i].cacheGlb(home);
146 }
147 if (ys[i].lubModified()) {
148 LubDiffRanges<View> yiub(ys[i]);
149 Iter::Ranges::ToValues<LubDiffRanges<View> > dv(yiub);
150 for (;dv();++dv)
151 GECODE_ME_CHECK(xs[dv.val()].nq(home,i));
152 ys[i].cacheLub(home);
153 }
154 }
155
156 return (assigned==xs.size()) ? home.ES_SUBSUMED(*this) : ES_NOFIX;
157 }
158
159}}}
160

Callers

nothing calls this directly

Calls 14

modifiedMethod · 0.80
cacheMethod · 0.80
glbModifiedMethod · 0.80
cacheGlbMethod · 0.80
lubModifiedMethod · 0.80
cacheLubMethod · 0.80
ES_SUBSUMEDMethod · 0.80
sizeMethod · 0.45
assignedMethod · 0.45
includeMethod · 0.45
valMethod · 0.45
excludeMethod · 0.45

Tested by

no test coverage detected