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

Method post

test/int/mm-bool.cpp:4337–4361  ·  view source on GitHub ↗

Post constraint on \a x

Source from the content-addressed store, hash-verified

4335 }
4336 /// Post constraint on \a x
4337 virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
4338 using namespace Gecode;
4339 BoolVarArgs l(2);
4340 l[0]=channel(home,x[0]); l[1]=channel(home,x[1]);
4341 switch (mode) {
4342 case 0:
4343 {
4344 BoolVar b0 = expr(home, !element(l,0));
4345 BoolVar b1 = expr(home, element(l,1));
4346 rel(home, b0 && b1);
4347 }
4348 break;
4349 case 1:
4350 {
4351 BoolVar b = expr(home, !element(l,0) && element(l,1));
4352 rel(home, b);
4353 }
4354 break;
4355 case 2:
4356 rel(home, !element(l,0) && element(l,1));
4357 break;
4358 default:
4359 GECODE_NEVER;
4360 }
4361 }
4362 };
4363
4364

Callers

nothing calls this directly

Calls 4

channelFunction · 0.50
exprFunction · 0.50
elementFunction · 0.50
relFunction · 0.50

Tested by

no test coverage detected