8 Ran(Ullong j
) : v(4101842887655102017LL), w(1) {
9 // Constructor. Call with any integer seed (except value of v above).
14 inline Ullong
int64() {
15 // Return 64-bit random integer.
16 u
= u
* 2862933555777941757LL + 7046029254386353087LL;
17 v
^= v
>> 17; v
^= v
<< 31; v
^= v
>> 8;
18 w
= 4294957665U*(w
& 0xffffffff) + (w
>> 32);
19 Ullong x
= u
^ (u
<< 21); x
^= x
>> 35; x
^= x
<< 4;
22 inline Doub
doub() { return 5.42101086242752217E-20 * int64(); }
23 // Return random double-precision floating value in the range 0. to 1.
24 inline Uint
int32() { return (Uint
)int64(); }
25 // Return 32-bit random integer.
30 Ranq1(Ullong j
) : v(4101842887655102017LL) {
34 inline Ullong
int64() {
35 v
^= v
>> 21; v
^= v
<< 35; v
^= v
>> 4;
36 return v
* 2685821657736338717LL;
38 inline Doub
doub() { return 5.42101086242752217E-20 * int64(); }
39 inline Uint
int32() { return (Uint
)int64(); }
44 Ranq2(Ullong j
) : v(4101842887655102017LL), w(1) {
49 inline Ullong
int64() {
50 v
^= v
>> 17; v
^= v
<< 31; v
^= v
>> 8;
51 w
= 4294957665U*(w
& 0xffffffff) + (w
>> 32);
54 inline Doub
doub() { return 5.42101086242752217E-20 * int64(); }
55 inline Uint
int32() { return (Uint
)int64(); }