Post constraint on \a x
| 107 | } |
| 108 | /// Post constraint on \a x |
| 109 | virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) { |
| 110 | Gecode::IntVarArgs y(4); |
| 111 | for (int i=0; i<4; i++) |
| 112 | y[i]=x[i]; |
| 113 | switch (irt) { |
| 114 | case Gecode::IRT_EQ: |
| 115 | Gecode::exactly(home,y,0,x[4]); break; |
| 116 | case Gecode::IRT_LQ: |
| 117 | Gecode::atmost(home,y,0,x[4]); break; |
| 118 | case Gecode::IRT_GQ: |
| 119 | Gecode::atleast(home,y,0,x[4]); break; |
| 120 | default: GECODE_NEVER; |
| 121 | } |
| 122 | } |
| 123 | }; |
| 124 | |
| 125 | /// %Test number of equal variables equal to integer variable |