Value selection function for load branching
| 175 | } |
| 176 | /// Value selection function for load branching |
| 177 | static int load(const Space& home, IntVar x, int) { |
| 178 | const BACP& b = static_cast<const BACP&>(home); |
| 179 | IntVarValues values(x); |
| 180 | int val = -1; |
| 181 | int best = Int::Limits::max+1; |
| 182 | while (values()) { |
| 183 | if (b.l[values.val()].min() < best) { |
| 184 | val = values.val(); |
| 185 | best = b.l[val].min(); |
| 186 | } |
| 187 | ++values; |
| 188 | } |
| 189 | assert(val != -1); |
| 190 | return val; |
| 191 | } |
| 192 | /// Value selection function for reverse load branching |
| 193 | static int load_rev(const Space& home, IntVar x, int) { |
| 194 | const BACP& b = static_cast<const BACP&>(home); |