| 73 | |
| 74 | |
| 75 | forceinline int |
| 76 | RandomAssignment::randval(Gecode::Support::RandomGenerator& rand) { |
| 77 | unsigned int skip = rand(d.size()); |
| 78 | for (Gecode::IntSetRanges it(d); true; ++it) { |
| 79 | if (it.width() > skip) |
| 80 | return it.min() + static_cast<int>(skip); |
| 81 | skip -= it.width(); |
| 82 | } |
| 83 | GECODE_NEVER; |
| 84 | return 0; |
| 85 | } |
| 86 | |
| 87 | inline |
| 88 | RandomAssignment::RandomAssignment(int n, const Gecode::IntSet& d, int a0, Gecode::Support::RandomGenerator& rand) |