| 200 | template<class View, int n, class Val, unsigned int a, |
| 201 | class Filter, class Print> |
| 202 | ExecStatus |
| 203 | LDSBSetBrancher<View,n,Val,a,Filter,Print> |
| 204 | ::commit(Space& home, const Choice& c, unsigned int b) { |
| 205 | const LDSBChoice<Val>& pvc |
| 206 | = static_cast<const LDSBChoice<Val>&>(c); |
| 207 | int choicePos = pvc.pos().pos; |
| 208 | int choiceVal = pvc.val(); |
| 209 | |
| 210 | if (!_stable) |
| 211 | updatePart1(home, choicePos); |
| 212 | |
| 213 | if (b == 0) { |
| 214 | IntArgs ia; |
| 215 | for (IntSetValues v(_leftBranchValues) ; v() ; ++v) { |
| 216 | ia << v.val(); |
| 217 | } |
| 218 | ia << choiceVal; |
| 219 | _leftBranchValues = IntSet(ia); |
| 220 | |
| 221 | // Post the branching constraint. |
| 222 | ExecStatus fromBase = ViewValBrancher<View,n,Val,a,Filter,Print> |
| 223 | ::commit(home, c, b); |
| 224 | GECODE_ES_CHECK(fromBase); |
| 225 | for (int i = 0 ; i < this->_nsyms ; i++) |
| 226 | this->_syms[i]->update(Literal(choicePos, choiceVal)); |
| 227 | } else if (b == 1) { |
| 228 | // Post the branching constraint. |
| 229 | ExecStatus fromBase = ViewValBrancher<View,n,Val,a,Filter,Print> |
| 230 | ::commit(home, c, b); |
| 231 | GECODE_ES_CHECK(fromBase); |
| 232 | |
| 233 | // Post prunings. |
| 234 | int nliterals = pvc.nliterals(); |
| 235 | const Literal* literals = pvc.literals(); |
| 236 | for (int i = 0 ; i < nliterals ; i++) { |
| 237 | const Literal& l = literals[i]; |
| 238 | ModEvent me = prune<View>(home, this->x[l._variable], l._value); |
| 239 | GECODE_ME_CHECK(me); |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | return ES_OK; |
| 244 | } |
| 245 | |
| 246 | template<class View, int n, class Val, unsigned int a, |
| 247 | class Filter, class Print> |