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

Method post

gecode/int/arithmetic/abs.hpp:92–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90
91 template<class View>
92 ExecStatus
93 AbsBnd<View>::post(Home home, View x0, View x1) {
94 if (x0.min() >= 0) {
95 return Rel::EqBnd<View,View>::post(home,x0,x1);
96 } else if (x0.max() <= 0) {
97 return Rel::EqBnd<MinusView,View>::post(home,MinusView(x0),x1);
98 } else {
99 assert(!x0.assigned());
100 GECODE_ME_CHECK(x1.gq(home,0));
101 if (x1.assigned()) {
102 int mp[2] = {-x1.val(),x1.val()};
103 Iter::Values::Array i(mp,2);
104 GECODE_ME_CHECK(x0.inter_v(home,i,false));
105 } else if (x0 != x1) {
106 GECODE_ME_CHECK(x1.lq(home,std::max(-x0.min(),x0.max())));
107 (void) new (home) AbsBnd<View>(home,x0,x1);
108 }
109 }
110 return ES_OK;
111 }
112
113 template<class View>
114 forceinline

Callers

nothing calls this directly

Calls 10

postFunction · 0.50
MinusViewClass · 0.50
maxFunction · 0.50
minMethod · 0.45
maxMethod · 0.45
assignedMethod · 0.45
gqMethod · 0.45
valMethod · 0.45
inter_vMethod · 0.45
lqMethod · 0.45

Tested by

no test coverage detected