Extend assignment \a x
| 209 | } |
| 210 | /// Extend assignment \a x |
| 211 | virtual bool extendAssignment(Assignment& x) const { |
| 212 | if ((x[0].max() <= 0.0) || (base <= 0.0)) |
| 213 | return false; |
| 214 | Gecode::FloatVal d = log(x[0])/log(base); |
| 215 | if (Gecode::Float::subset(d, dom)) { |
| 216 | x.set(1, d); |
| 217 | return true; |
| 218 | } else { |
| 219 | return false; |
| 220 | } |
| 221 | } |
| 222 | /// Post constraint on \a x |
| 223 | virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) { |
| 224 | Gecode::log(home, base, x[0], x[1]); |