MCPcopy Create free account
hub / github.com/Gecode/gecode / randval

Method randval

test/int.hpp:75–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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)

Callers 1

nextMethod · 0.95

Calls 3

sizeMethod · 0.45
widthMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected