Extend assignment \a x
| 123 | } |
| 124 | /// Extend assignment \a x |
| 125 | virtual bool extendAssignment(Assignment& x) const { |
| 126 | Gecode::FloatVal d = x[0]*x[0]; |
| 127 | if (Gecode::Float::subset(d, dom)) { |
| 128 | x.set(1, d); |
| 129 | return true; |
| 130 | } else { |
| 131 | return false; |
| 132 | } |
| 133 | } |
| 134 | /// Post constraint on \a x |
| 135 | virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) { |
| 136 | Gecode::mult(home, x[0], x[0], x[1]); |