Post constraint on \a xwyho
| 116 | } |
| 117 | /// Post constraint on \a xwyho |
| 118 | virtual void post(Gecode::Space& home, Gecode::IntVarArray& xyo) { |
| 119 | using namespace Gecode; |
| 120 | int n = xyo.size() / 3; |
| 121 | IntVarArgs x(n), y(n); |
| 122 | BoolVarArgs o(n); |
| 123 | for (int i=0; i<n; i++) { |
| 124 | x[i]=xyo[3*i+0]; y[i]=xyo[3*i+1]; |
| 125 | o[i]=expr(home, xyo[3*i+2] > 0); |
| 126 | } |
| 127 | nooverlap(home, x, w, y, h, o); |
| 128 | } |
| 129 | }; |
| 130 | |
| 131 | /// %Test for no-overlap with variable dimensions (rectangles) |