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

Method setup

test/ldsb.cpp:796–809  ·  view source on GitHub ↗

Setup problem constraints and symmetries

Source from the content-addressed store, hash-verified

794 static const int u = 8;
795 /// Setup problem constraints and symmetries
796 static void setup(Home home, IntVarArray& xs) {
797 TupleSet tuples(3);
798 tuples.add({1,1,1}).add({4,4,4}).add({7,7,7})
799 .add({0,1,5}).add({0,1,8}).add({3,4,2})
800 .add({3,4,8}).add({6,7,2}).add({6,7,5})
801 .finalize();
802 extensional(home, xs, tuples);
803
804 // Values 0,1,2 are symmetric with 3,4,5, and with 6,7,8.
805 IntArgs values({0,1,2, 3,4,5, 6,7,8});
806 Symmetries s;
807 s << ValueSequenceSymmetry(values, 3);
808 branch(home, xs, INT_VAR_NONE(), INT_VAL_MIN(), s);
809 }
810 /// Compute list of expected solutions
811 static std::vector<IntArgs> expectedSolutions(void) {
812 static std::vector<IntArgs> expected;

Callers

nothing calls this directly

Calls 7

ValueSequenceSymmetryFunction · 0.85
INT_VAR_NONEFunction · 0.85
INT_VAL_MINFunction · 0.85
extensionalFunction · 0.50
branchFunction · 0.50
finalizeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected