36namespace Gecode {
namespace Support {
45 template<
unsigned int m,
unsigned int a,
unsigned int q,
unsigned int r>
49 static const unsigned int max = 1UL<<31;
53 unsigned int next(
void);
56 void seed(
unsigned int s);
60 unsigned int seed(
void)
const;
64 size_t size(
void)
const;
67 template<
unsigned int m,
unsigned int a,
unsigned int q,
unsigned int r>
70 s =
a*(s%q) -
r*(s/q);
75 template<
unsigned int m,
unsigned int a,
unsigned int q,
unsigned int r>
81 template<
unsigned int m,
unsigned int a,
unsigned int q,
unsigned int r>
87 template<
unsigned int m,
unsigned int a,
unsigned int q,
unsigned int r>
92 template<
unsigned int m,
unsigned int a,
unsigned int q,
unsigned int r>
95 unsigned int x1 = next() & ((1<<16)-1);
96 unsigned int x2 = next() & ((1<<16)-1);
98 double d =
static_cast<double>(((x1<<16) | x2) %
max) /
max;
99 unsigned int val =
static_cast<unsigned int>(
n * d);
100 return (val <
n) ? val : (
n-1);
102 template<
unsigned int m,
unsigned int a,
unsigned int q,
unsigned int r>
int n
Number of negative literals for node type.
struct Gecode::@603::NNF::@65::@67 a
For atomic nodes.
Template for linear congruential generators.
size_t size(void) const
Report size occupied.
unsigned int operator()(unsigned int n)
Returns a random integer from the interval [0..n)
LinearCongruentialGenerator(unsigned int s=1)
Construct the generator instance with seed s.
unsigned int seed(void) const
Return current seed.
LinearCongruentialGenerator< 2147483647, 48271, 44488, 3399 > RandomGenerator
Default values for linear congruential generator.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .