40822aaac0cad8e1f9bac07723e8c15376b54ea5
5 #include "Util/types.h"
7 #define INV_RANDMAX 2.3283064370807974E-10 // 1/0xffffffff
9 // If (flag!=0), then use a random array to initialize mm[]
10 #define mix(a,b,c,d,e,f,g,h) \
12 a^=b<<11; d+=a; b+=c; \
13 b^=c>>2; e+=b; c+=d; \
14 c^=d<<8; f+=c; d+=e; \
15 d^=e>>16; g+=d; e+=f; \
16 e^=f<<10; h+=e; f+=g; \
17 f^=g>>4; a+=f; g+=h; \
18 g^=h<<8; b+=g; h+=a; \
19 h^=a>>9; c+=h; a+=b; \
22 // initialize the (pseudo-)random generator
23 // NOTE: flag has only two states, active or not.
24 // flag != 0 --> "maximal randomness"
25 void init_rng(int flag
);
27 // return a (pseudo-)random integer
28 uint32_t get_rand_int();
30 // return a (pseudo-)random real number in [0,1]