%Test whether \a x is solution
| 102 | : SetTest("Precede::Multi::"+str(c0),4,ds,false), c(c0) {} |
| 103 | /// %Test whether \a x is solution |
| 104 | virtual bool solution(const SetAssignment& x) const { |
| 105 | for (int j=0; j<c.size()-1; j++) |
| 106 | for (int i=0; i<x.size(); i++) { |
| 107 | if (!in(c[j],x[i]) && in(c[j+1],x[i])) |
| 108 | return false; |
| 109 | if (in(c[j],x[i]) && !in(c[j+1],x[i])) |
| 110 | break; |
| 111 | } |
| 112 | return true; |
| 113 | } |
| 114 | /// Post constraint on \a x |
| 115 | virtual void post(Gecode::Space& home, Gecode::SetVarArray& x, |
| 116 | Gecode::IntVarArray&) { |