| 69 | |
| 70 | template<class A, class B> |
| 71 | ExecStatus |
| 72 | Abs<A,B>::propagate(Space& home, const ModEventDelta&) { |
| 73 | GECODE_ME_CHECK(x1.eq(home,abs(x0.val()))); |
| 74 | if (x0.min() >= 0) |
| 75 | GECODE_ME_CHECK(x0.eq(home,FloatVal(x1.min(), x1.max()))); |
| 76 | else if (x0.max() <= 0) |
| 77 | GECODE_ME_CHECK(x0.eq(home,FloatVal(-x1.max(), -x1.min()))); |
| 78 | else |
| 79 | GECODE_ME_CHECK(x0.eq(home,FloatVal(-x1.max(), x1.max()))); |
| 80 | return (x0.assigned() && x1.assigned()) ? home.ES_SUBSUMED(*this) : ES_FIX; |
| 81 | } |
| 82 | |
| 83 | }}} |
| 84 |