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

Method propagate

gecode/int/circuit/dom.hpp:77–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75
76 template<class View, class Offset>
77 ExecStatus
78 Dom<View,Offset>::propagate(Space& home, const ModEventDelta& med) {
79 if (View::me(med) == Int::ME_INT_VAL) {
80 GECODE_ES_CHECK((Int::Distinct::prop_val<View,true>(home,y)));
81 ExecStatus escv = connected(home);
82 if (escv != ES_FIX)
83 return escv;
84 if (y.size() < 2)
85 return home.ES_SUBSUMED(*this);
86 return home.ES_FIX_PARTIAL(*this,View::med(Int::ME_INT_DOM));
87 }
88
89 if (dc.available()) {
90 GECODE_ES_CHECK(dc.sync());
91 } else {
92 GECODE_ES_CHECK(dc.init(home,y));
93 }
94 bool assigned;
95 GECODE_ES_CHECK(dc.propagate(home,assigned));
96
97 ExecStatus esc = connected(home);
98 if (esc != ES_FIX)
99 return esc;
100
101 // Eliminate assigned views from y, as they have been assigned
102 // and propagated by domain consistent propagation. This is required
103 // as we need to know how many assigned views actually exist.
104 if (assigned)
105 for (int i=y.size(); i--; )
106 if (y[i].assigned())
107 y.move_lst(i);
108
109 return path(home);
110 }
111
112 template<class View, class Offset>
113 ExecStatus

Callers

nothing calls this directly

Calls 9

pathFunction · 0.85
ES_SUBSUMEDMethod · 0.80
ES_FIX_PARTIALMethod · 0.80
availableMethod · 0.80
sizeMethod · 0.45
syncMethod · 0.45
initMethod · 0.45
assignedMethod · 0.45
move_lstMethod · 0.45

Tested by

no test coverage detected