43 namespace Test {
namespace Int {
75 dsv(new
Gecode::IntSetValues[static_cast<unsigned int>(m+
n)]) {
103 if (
dsv[
i]() || (
i == 0)) {
106 for (
int k=0;k<
n_bins; k++)
151 :
Test(
"BinPacking::"+
str(m0)+
"::"+
str(s0)+
"::"+(
v ?
"+" :
"-"),
152 m0+s0.
size(), 0, 100),
213 for (
int m=1;
m<4;
m++) {
214 (void)
new BPT(
m, s1);
215 (void)
new BPT(
m, s2);
216 (void)
new BPT(
m, s3);
217 (void)
new BPT(
m, s4);
218 (void)
new BPT(
m, s5);
219 (void)
new BPT(
m, s6);
220 (void)
new BPT(
m, s7);
221 (void)
new BPT(
m, s8);
222 (void)
new BPT(
m, s9);
223 (void)
new BPT(
m, s1,
false);
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
int n_items
Number of items.
int size(void) const
Return size of array (number of elements)
Create(void)
Perform creation and registration.
void init(const IntSet &s)
Initialize with values for s.
Gecode::IntArgs s
Item sizes.
struct Gecode::@511::NNF::@54::@55 b
For binary nodes (and, or, eqv)
bool valid
Whether to generate only valid loads.
virtual ~LoadBinAssignment(void)
Destructor.
int il[4]
Array of sufficient size for computing item loads.
Gecode::IntSet d_bin
Domain for bin variables.
static int total(const Gecode::IntArgs &s)
Compute total size.
virtual void operator++(void)
Move to next assignment.
int val(void) const
Return current value.
int n
Number of variables.
int n_bins
Number of bins.
static std::string str(Gecode::ExtensionalPropKind epk)
Map extensional propagation kind to string.
Gecode::IntArgs i(4, 1, 2, 3, 4)
Help class to create and register tests.
Gecode::IntSetValues * dsv
Iterator for each variable.
virtual int operator[](int i) const
Return value for variable i.
unsigned int size(I &i)
Size of all ranges of range iterator i.
virtual Assignment * assignment(void) const
Create assignment.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Passing integer variables.
Passing integer arguments.
Generate load and bin assignments.
struct Gecode::@511::NNF::@54::@56 a
For atomic nodes.
Node * x
Pointer to corresponding Boolean expression node.
Test with different bin loads and items
Gecode::IntSet d_load
Domain for load variables.
bool testsearch
Whether to perform search test.
Base class for assignments
Value iterator for integer sets.
void binpacking(Home home, const IntVarArgs &l, const IntVarArgs &b, const IntArgs &s, IntConLevel)
Post propagator for bin packing.
Gecode toplevel namespace
BPT(int m0, const Gecode::IntArgs &s0, bool v=true)
Create and register test for m bins and item sizes s.
virtual bool operator()(void) const
Test whether all assignments have been iterated.
LoadBinAssignment(int m, const Gecode::IntSet &d_m, int n, const Gecode::IntSet &d_n, int l)
Initialize assignments for load and bin variables.
int load
Load to generate (unless -1)