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

Method post

gecode/int/member/re-prop.hpp:47–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45
46 template<class View, ReifyMode rm>
47 inline ExecStatus
48 ReProp<View,rm>::post(Home home, ViewArray<View>& x, View y, BoolView b) {
49 if (x.size() == 0) {
50 if (rm != RM_PMI)
51 GECODE_ME_CHECK(b.zero(home));
52 return ES_OK;
53 }
54
55 x.unique();
56
57 if (x.size() == 1)
58 return Rel::ReEqDom<View,BoolView,rm>::post(home,x[0],y,b);
59
60 if (x.same(y)) {
61 if (rm != RM_IMP)
62 GECODE_ME_CHECK(b.one(home));
63 return ES_OK;
64 }
65
66 // Eliminate assigned views and store them into the value set
67 ValSet vs;
68 add(home, vs, x);
69
70 switch (vs.compare(y)) {
71 case Iter::Ranges::CS_SUBSET:
72 if (rm != RM_IMP)
73 GECODE_ME_CHECK(b.one(home));
74 return ES_OK;
75 case Iter::Ranges::CS_DISJOINT:
76 if (x.size() == 0) {
77 if (rm != RM_PMI)
78 GECODE_ME_CHECK(b.zero(home));
79 return ES_OK;
80 }
81 break;
82 case Iter::Ranges::CS_NONE:
83 break;
84 default:
85 GECODE_NEVER;
86 }
87
88 (void) new (home) ReProp<View,rm>(home, vs, x, y, b);
89 return ES_OK;
90 }
91
92 template<class View, ReifyMode rm>
93 forceinline

Callers

nothing calls this directly

Calls 8

addFunction · 0.85
postFunction · 0.50
sizeMethod · 0.45
zeroMethod · 0.45
uniqueMethod · 0.45
sameMethod · 0.45
oneMethod · 0.45
compareMethod · 0.45

Tested by

no test coverage detected