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

Method propagate

gecode/int/nvalues/int-lq.hpp:111–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109
110 template<class VY>
111 ExecStatus
112 LqInt<VY>::propagate(Space& home, const ModEventDelta& med) {
113 // Add assigned views to value set
114 if (IntView::me(med) == ME_INT_VAL)
115 add(home);
116
117 GECODE_ME_CHECK(y.gq(home, vs.size()));
118
119 if (x.size() == 0)
120 return home.ES_SUBSUMED(*this);
121
122 // All values must be in the value set
123 if (y.max() == vs.size())
124 return all_in_valset(home);
125
126 if (x.size() + vs.size() <= y.min())
127 return home.ES_SUBSUMED(*this);
128
129 // Compute positions of disjoint views
130 Region r;
131 int* dis; int n_dis;
132 disjoint(home,r,dis,n_dis);
133
134 // Some views might have been eliminated as they are subsumed
135 if (x.size() == 0)
136 return home.ES_SUBSUMED(*this);
137
138 // No lower bound pruning possible
139 if (n_dis == 0)
140 return ES_NOFIX;
141
142 // Do lower bound-based pruning
143 GECODE_ES_CHECK(prune_lower(home,dis,n_dis));
144
145 return ES_NOFIX;
146 }
147
148}}}
149

Callers

nothing calls this directly

Calls 7

addFunction · 0.85
disjointFunction · 0.85
ES_SUBSUMEDMethod · 0.80
gqMethod · 0.45
sizeMethod · 0.45
maxMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected