MCPcopy Create free account
hub / github.com/Gecode/gecode / post

Method post

test/int/no-overlap.cpp:196–209  ·  view source on GitHub ↗

Post constraint on \a xwyho

Source from the content-addressed store, hash-verified

194 }
195 /// Post constraint on \a xwyho
196 virtual void post(Gecode::Space& home, Gecode::IntVarArray& xwyho) {
197 using namespace Gecode;
198 int n = xwyho.size() / 5;
199 IntVarArgs x0(n), w(n), x1(n), y0(n), h(n), y1(n);
200 BoolVarArgs o(n);
201 for (int i=0; i<n; i++) {
202 x0[i]=xwyho[5*i+0]; w[i]=xwyho[5*i+1];
203 x1[i]=expr(home, x0[i] + w[i]);
204 y0[i]=xwyho[5*i+2]; h[i]=xwyho[5*i+3];
205 y1[i]=expr(home, y0[i] + h[i]);
206 o[i]=expr(home, xwyho[5*i+4] > 0);
207 }
208 nooverlap(home, x0, w, x1, y0, h, y1, o);
209 }
210 };
211
212 /// %Test for no-overlap with optional rectangles and shared variables

Callers

nothing calls this directly

Calls 3

nooverlapFunction · 0.85
exprFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected