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

Method setup

test/ldsb.cpp:1532–1546  ·  view source on GitHub ↗

Setup problem constraints and symmetries

Source from the content-addressed store, hash-verified

1530 static const int u = 6;
1531 /// Setup problem constraints and symmetries
1532 static void setup(Home home, IntVarArray& xs) {
1533 Matrix<IntVarArray> m(xs, 3, 2);
1534
1535 distinct(home, xs);
1536 rel(home, abs(m(0,0)-m(1,0))==1);
1537 rel(home, abs(m(0,1)-m(1,1))==1);
1538 rel(home, abs(m(1,0)-m(2,0))==1);
1539 rel(home, abs(m(1,1)-m(2,1))==1);
1540
1541 Symmetries s;
1542 s << values_reflect(l, u);
1543 s << rows_interchange(m);
1544 s << columns_reflect(m);
1545 branch(home, xs, INT_VAR_NONE(), INT_VAL_MIN(), s);
1546 }
1547 /// Compute list of expected solutions
1548 static std::vector<IntArgs> expectedSolutions(void) {
1549 static std::vector<IntArgs> expected;

Callers

nothing calls this directly

Calls 10

distinctFunction · 0.85
mFunction · 0.85
values_reflectFunction · 0.85
rows_interchangeFunction · 0.85
columns_reflectFunction · 0.85
INT_VAR_NONEFunction · 0.85
INT_VAL_MINFunction · 0.85
relFunction · 0.50
absFunction · 0.50
branchFunction · 0.50

Tested by

no test coverage detected