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

Function binpacking

gecode/int/bin-packing.cpp:40–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38namespace Gecode {
39
40 void
41 binpacking(Home home,
42 const IntVarArgs& l,
43 const IntVarArgs& b, const IntArgs& s,
44 IntPropLevel) {
45 using namespace Int;
46 if (same(l,b))
47 throw ArgumentSame("Int::binpacking");
48 if (b.size() != s.size())
49 throw ArgumentSizeMismatch("Int::binpacking");
50 for (int i=0; i<s.size(); i++)
51 Limits::nonnegative(s[i],"Int::binpacking");
52 GECODE_POST;
53
54 ViewArray<OffsetView> lv(home,l.size());
55 for (int i=0; i<l.size(); i++)
56 lv[i] = OffsetView(l[i],0);
57
58 ViewArray<BinPacking::Item> bs(home,b.size());
59 for (int i=0; i<bs.size(); i++)
60 bs[i] = BinPacking::Item(b[i],s[i]);
61
62 GECODE_ES_FAIL(Int::BinPacking::Pack::post(home,lv,bs));
63 }
64
65 IntSet
66 binpacking(Home home, int d,

Callers 6

postMethod · 0.85
postMethod · 0.85
runMethod · 0.85
BinPackingMethod · 0.85
MultiBinPackingMethod · 0.85
p_bin_packing_loadFunction · 0.85

Calls 13

ItemClass · 0.85
me_failedFunction · 0.85
edgeMethod · 0.80
maxcliqueMethod · 0.80
OffsetViewClass · 0.70
sameFunction · 0.50
postFunction · 0.50
sizeMethod · 0.45
failedMethod · 0.45
lqMethod · 0.45
failMethod · 0.45
valMethod · 0.45

Tested by

no test coverage detected