The actual problem
| 60 | IntVarArray q; |
| 61 | /// The actual problem |
| 62 | Queens(IntValBranch ivb, bool assign, bool null) |
| 63 | : q(*this,n,0,n-1) { |
| 64 | distinct(*this, IntArgs::create(n,0,1), q, IPL_VAL); |
| 65 | distinct(*this, IntArgs::create(n,0,-1), q, IPL_VAL); |
| 66 | distinct(*this, q, IPL_VAL); |
| 67 | if (assign) { |
| 68 | IntVar x(*this,0,1); Gecode::assign(*this, x, INT_ASSIGN_MIN()); |
| 69 | } |
| 70 | { |
| 71 | IntVarArgs q1(n/2), q2(n/2); |
| 72 | for (int i=0; i<n/2; i++) { |
| 73 | q1[i] = q[i]; q2[i] = q[n/2 + i]; |
| 74 | } |
| 75 | branch(*this, q1, INT_VAR_NONE(), ivb); |
| 76 | if (null) |
| 77 | branch(*this, &dummy); |
| 78 | branch(*this, q2, INT_VAR_NONE(), ivb); |
| 79 | } |
| 80 | if (assign) { |
| 81 | IntVar x(*this,0,1); Gecode::assign(*this, x, INT_ASSIGN_MIN()); |
| 82 | } |
| 83 | } |
| 84 | /// Constructor for cloning \a s |
| 85 | Queens(Queens& s) : Space(s) { |
| 86 | q.update(*this, s.q); |
nothing calls this directly
no test coverage detected