| 36 | namespace Gecode { namespace Int { namespace Branch { |
| 37 | |
| 38 | PosValuesChoice::PosValuesChoice(const Brancher& b, const Pos& p, IntView x) |
| 39 | : PosChoice(b,x.size(),p), n(0) { |
| 40 | for (ViewRanges<IntView> r(x); r(); ++r) |
| 41 | n++; |
| 42 | pm = heap.alloc<PosMin>(n+1); |
| 43 | unsigned int w=0; |
| 44 | int i=0; |
| 45 | for (ViewRanges<IntView> r(x); r(); ++r) { |
| 46 | pm[i].min = r.min(); |
| 47 | pm[i].pos = w; |
| 48 | w += r.width(); i++; |
| 49 | } |
| 50 | pm[i].pos = w; |
| 51 | } |
| 52 | |
| 53 | PosValuesChoice::PosValuesChoice(const Brancher& b, unsigned int a, Pos p, |
| 54 | Archive& e) |