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

Method propagate

gecode/int/count/view-gq.hpp:67–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65
66 template<class VX, class VY, class VZ, bool shr, bool dom>
67 ExecStatus
68 GqView<VX,VY,VZ,shr,dom>::propagate(Space& home, const ModEventDelta&) {
69 count(home);
70
71 GECODE_ME_CHECK(z.lq(home,atmost()));
72
73 if (z.min() == atmost()) {
74 GECODE_ES_CHECK(post_true(home,x,y));
75 return home.ES_SUBSUMED(*this);
76 }
77 if (x.size() == 0)
78 return home.ES_SUBSUMED(*this);
79
80 if (z.assigned() && (!dom ||isval(y))) {
81 VY yc(y);
82 GECODE_REWRITE(*this,(GqInt<VX,VY>::post(home(*this),x,yc,z.val()+c)));
83 }
84
85 if (dom && !isval(y) && (z.min() > 0)) {
86 /*
87 * Only if the propagator is at fixpoint here, continue
88 * when things are shared: the reason is that prune
89 * requires that the views in x overlap with y!
90 */
91 if (shr && (VX::me(Propagator::modeventdelta()) != ME_INT_NONE))
92 return ES_NOFIX;
93
94 GECODE_ES_CHECK(prune(home,x,y));
95
96 return ES_NOFIX;
97 }
98
99 return shr ? ES_NOFIX : ES_FIX;
100 }
101
102}}}
103

Callers

nothing calls this directly

Calls 10

atmostFunction · 0.85
isvalFunction · 0.85
ES_SUBSUMEDMethod · 0.80
countFunction · 0.50
postFunction · 0.50
lqMethod · 0.45
minMethod · 0.45
sizeMethod · 0.45
assignedMethod · 0.45
valMethod · 0.45

Tested by

no test coverage detected