| 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 |