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

Method post

gecode/int/bool/eqv.hpp:47–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45
46 template<class BVA, class BVB, class BVC>
47 inline ExecStatus
48 Eqv<BVA,BVB,BVC>::post(Home home, BVA b0, BVB b1, BVC b2){
49 switch (bool_test(b0,b1)) {
50 case BT_SAME:
51 GECODE_ME_CHECK(b2.one(home)); break;
52 case BT_COMP:
53 GECODE_ME_CHECK(b2.zero(home)); break;
54 case BT_NONE:
55 if (b2.one())
56 return Eq<BVA,BVB>::post(home,b0,b1);
57 if (b0.one()) {
58 if (b1.one()) {
59 GECODE_ME_CHECK(b2.one(home)); return ES_OK;
60 } else if (b1.zero()) {
61 GECODE_ME_CHECK(b2.zero(home)); return ES_OK;
62 }
63 }
64 if (b0.zero()) {
65 if (b1.one()) {
66 GECODE_ME_CHECK(b2.zero(home)); return ES_OK;
67 } else if (b1.zero()) {
68 GECODE_ME_CHECK(b2.one(home)); return ES_OK;
69 }
70 }
71 (void) new (home) Eqv(home,b0,b1,b2);
72 break;
73 default:
74 GECODE_NEVER;
75 }
76 return ES_OK;
77 }
78
79 template<class BVA, class BVB, class BVC>
80 Actor*

Callers

nothing calls this directly

Calls 4

bool_testFunction · 0.85
postFunction · 0.50
oneMethod · 0.45
zeroMethod · 0.45

Tested by

no test coverage detected