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

Function nooverlap

gecode/int/no-overlap.cpp:50–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48 }}
49
50 void
51 nooverlap(Home home,
52 const IntVarArgs& x, const IntArgs& w,
53 const IntVarArgs& y, const IntArgs& h,
54 IntPropLevel) {
55 using namespace Int;
56 using namespace NoOverlap;
57 if ((x.size() != w.size()) || (x.size() != y.size()) ||
58 (x.size() != h.size()))
59 throw ArgumentSizeMismatch("Int::nooverlap");
60 for (int i=0; i<x.size(); i++) {
61 Limits::nonnegative(w[i],"Int::nooverlap");
62 Limits::nonnegative(h[i],"Int::nooverlap");
63 Limits::check(static_cast<long long int>(x[i].max()) + w[i],
64 "Int::nooverlap");
65 Limits::check(static_cast<long long int>(y[i].max()) + h[i],
66 "Int::nooverlap");
67 }
68 GECODE_POST;
69
70 ManBox<FixDim,2>* b
71 = static_cast<Space&>(home).alloc<ManBox<FixDim,2> >(x.size());
72 for (int i=0; i<x.size(); i++) {
73 b[i][0] = FixDim(x[i],w[i]);
74 b[i][1] = FixDim(y[i],h[i]);
75 }
76
77 GECODE_ES_FAIL((
78 NoOverlap::ManProp<ManBox<FixDim,2> >::post(home,b,x.size())));
79 }
80
81 void
82 nooverlap(Home home,

Callers 8

postMethod · 0.85
postMethod · 0.85
postMethod · 0.85
postMethod · 0.85
postMethod · 0.85
PerfectSquareMethod · 0.85
p_nooverlapFunction · 0.85
nooverlapMethod · 0.85

Calls 13

FixDimClass · 0.85
optionalFunction · 0.85
FlexDimClass · 0.85
IntViewClass · 0.70
checkFunction · 0.50
postFunction · 0.50
sizeMethod · 0.45
maxMethod · 0.45
optionalMethod · 0.45
oneMethod · 0.45
gqMethod · 0.45
assignedMethod · 0.45

Tested by

no test coverage detected