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

Method resubscribe

gecode/int/linear/bool-int.hpp:432–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

430
431 template<class VX>
432 forceinline bool
433 NqBoolInt<VX>::resubscribe(Space& home, VX& y) {
434 if (y.one())
435 c--;
436 int n = x.size();
437 for (int i=n; i--; )
438 if (x[i].one()) {
439 c--; x[i]=x[--n];
440 } else if (x[i].zero()) {
441 x[i] = x[--n];
442 } else {
443 // New unassigned view found
444 assert(!x[i].zero() && !x[i].one());
445 // Move to y and subscribe
446 y=x[i]; x[i]=x[--n];
447 x.size(n);
448 y.subscribe(home,*this,PC_INT_VAL,false);
449 return true;
450 }
451 // All views have been assigned!
452 x.size(0);
453 return false;
454 }
455
456 template<class VX>
457 ExecStatus

Callers

nothing calls this directly

Calls 4

oneMethod · 0.45
sizeMethod · 0.45
zeroMethod · 0.45
subscribeMethod · 0.45

Tested by

no test coverage detected