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

Method prune_val

gecode/int/element/int.hpp:243–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241
242 template<class V0, class V1, class Idx, class Val>
243 void
244 Int<V0,V1,Idx,Val>::prune_val(void) {
245 Idx p = 0;
246 Idx i = iv[p].val_next;
247 ViewRanges<V1> v(x1);
248 while (v() && (i != 0)) {
249 if (iv[i].marked()) {
250 i=iv[i].val_next; iv[p].val_next=i;
251 } else if (iv[i].val < v.min()) {
252 iv[i].mark(); i=iv[i].val_next; iv[p].val_next=i;
253 } else if (iv[i].val > v.max()) {
254 ++v;
255 } else {
256 p=i; i=iv[i].val_next;
257 }
258 }
259 iv[p].val_next = 0;
260 while (i != 0) {
261 iv[i].mark(); i=iv[i].val_next;
262 }
263 }
264
265 template<class V0, class V1, class Idx, class Val>
266 ExecStatus

Callers

nothing calls this directly

Calls 4

markedMethod · 0.45
minMethod · 0.45
markMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected