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

Method setup

test/ldsb.cpp:663–675  ·  view source on GitHub ↗

Setup problem constraints and symmetries

Source from the content-addressed store, hash-verified

661 static const int u = 3;
662 /// Setup problem constraints and symmetries
663 static void setup(Home home, IntVarArray& xs) {
664 Matrix<IntVarArray> m(xs, 3, 4);
665 // The values in the first column are distinct.
666 distinct(home, m.col(0));
667 // Each row sums to 3.
668 for (int i = 0 ; i < 4 ; ++i)
669 linear(home, m.row(i), IRT_EQ, 3);
670
671 // Rows are interchangeable.
672 Symmetries s;
673 s << VariableSequenceSymmetry(xs, 3);
674 branch(home, xs, INT_VAR_NONE(), INT_VAL_MIN(), s);
675 }
676 /// Compute list of expected solutions
677 static std::vector<IntArgs> expectedSolutions(void) {
678 static std::vector<IntArgs> expected;

Callers

nothing calls this directly

Calls 8

distinctFunction · 0.85
INT_VAR_NONEFunction · 0.85
INT_VAL_MINFunction · 0.85
linearFunction · 0.50
VariableSequenceSymmetryFunction · 0.50
branchFunction · 0.50
colMethod · 0.45
rowMethod · 0.45

Tested by

no test coverage detected