Post constraint on \a x
| 127 | } |
| 128 | /// Post constraint on \a x |
| 129 | virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) { |
| 130 | int n = (c >= 0) ? x.size() : x.size()-1; |
| 131 | Gecode::IntVarArgs xx; |
| 132 | if (o==0) { |
| 133 | xx=x.slice(0,1,n); |
| 134 | } else { |
| 135 | xx=Gecode::IntVarArgs(n); |
| 136 | for (int i=n; i--;) |
| 137 | xx[i]=Gecode::expr(home,x[i]+o,Gecode::IPL_DOM); |
| 138 | } |
| 139 | if (c >= 0) { |
| 140 | Gecode::cumulative(home, c, xx, p, u, ipl); |
| 141 | } else { |
| 142 | Gecode::rel(home, x[n] <= -c); |
| 143 | Gecode::cumulative(home, x[n], xx, p, u, ipl); |
| 144 | } |
| 145 | } |
| 146 | }; |
| 147 | |
| 148 |
nothing calls this directly
no test coverage detected