Setup problem constraints and symmetries
| 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; |
nothing calls this directly
no test coverage detected