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

Method post

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

Post constraint on \a xwyh

Source from the content-addressed store, hash-verified

152 }
153 /// Post constraint on \a xwyh
154 virtual void post(Gecode::Space& home, Gecode::IntVarArray& xwyh) {
155 using namespace Gecode;
156 int n = xwyh.size() / 4;
157 IntVarArgs x0(n), w(n), x1(n), y0(n), h(n), y1(n);
158 for (int i=0; i<n; i++) {
159 x0[i]=xwyh[4*i+0]; w[i]=xwyh[4*i+1];
160 x1[i]=expr(home, x0[i] + w[i]);
161 y0[i]=xwyh[4*i+2]; h[i]=xwyh[4*i+3];
162 y1[i]=expr(home, y0[i] + h[i]);
163 }
164 nooverlap(home, x0, w, x1, y0, h, y1);
165 }
166 };
167
168 /// %Test for no-overlap with optional rectangles

Callers

nothing calls this directly

Calls 3

nooverlapFunction · 0.85
exprFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected