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

Method propagate

gecode/set/rel-op/superofinter.hpp:71–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69
70 template<class View0, class View1, class View2>
71 ExecStatus
72 SuperOfInter<View0,View1,View2>::propagate(Space& home, const ModEventDelta& med) {
73
74 bool allassigned = x0.assigned() && x1.assigned() && x2.assigned();
75
76 ModEvent me0 = View0::me(med);
77 ModEvent me1 = View1::me(med);
78 ModEvent me2 = View2::me(med);
79
80 bool modified = false;
81
82 do {
83 // glb(x2) >= glb(x0) ^ glb(x1)
84 if ( modified || Rel::testSetEventLB(me0,me1)) {
85 GlbRanges<View0> lb0(x0);
86 GlbRanges<View1> lb1(x1);
87 Iter::Ranges::Inter<GlbRanges<View0>,GlbRanges<View1> >
88 is(lb0, lb1);
89
90 GECODE_ME_CHECK_MODIFIED(modified,x2.includeI(home,is));
91 }
92
93 // lub(x0) -= glb(x1)-lub(x2)
94 // lub(x1) -= glb(x0)-lub(x2)
95 if ( modified || Rel::testSetEventAnyB(me0,me1,me2)) {
96 modified = false;
97 GlbRanges<View1> lb12(x1);
98 LubRanges<View2> ub22(x2);
99 Iter::Ranges::Diff<GlbRanges<View1>, LubRanges<View2> >
100 diff1(lb12, ub22);
101
102 GECODE_ME_CHECK_MODIFIED(modified, x0.excludeI(home,diff1));
103
104 GlbRanges<View0> lb01(x0);
105 LubRanges<View2> ub23(x2);
106 Iter::Ranges::Diff<GlbRanges<View0>, LubRanges<View2> >
107 diff2(lb01, ub23);
108
109 GECODE_ME_CHECK_MODIFIED(modified, x1.excludeI(home,diff2));
110 } else {
111 modified = false;
112 }
113
114 // Cardinality propagation
115 if ( modified ||
116 Rel::testSetEventCard(me0,me1,me2) ||
117 Rel::testSetEventUB(me0,me1)
118 ) {
119
120 LubRanges<View0> ub0(x0);
121 LubRanges<View1> ub1(x1);
122 Iter::Ranges::Union<LubRanges<View0>, LubRanges<View1> > u(ub0,ub1);
123
124 unsigned int m = Iter::Ranges::size(u);
125
126 if (m < x0.cardMin() + x1.cardMin()) {
127 GECODE_ME_CHECK_MODIFIED(modified,
128 x2.cardMin( home,

Callers

nothing calls this directly

Calls 12

testSetEventLBFunction · 0.85
testSetEventAnyBFunction · 0.85
testSetEventCardFunction · 0.85
testSetEventUBFunction · 0.85
ES_SUBSUMEDMethod · 0.80
sharedFunction · 0.70
sizeFunction · 0.50
assignedMethod · 0.45
includeIMethod · 0.45
excludeIMethod · 0.45
cardMinMethod · 0.45
cardMaxMethod · 0.45

Tested by

no test coverage detected