You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All generators, being based on linear recurrences, provide jump functions that make it possible to simulate any number of calls to the next-state function in constant time, once a suitable jump polynomial has been computed. We provide ready-made jump functions for a number of calls equal to the square root of the period, to make it easy generating non-overlapping sequences for parallel computations.
Would it be possible to implement jump functions in this package?
This seems like a nice addition for parallel usage.
The text was updated successfully, but these errors were encountered:
Thanks for the suggestion. I will look into how to implement jump functions for Xorshift family. Maybe you can also have a look at the advance! functions provided by PCG family.
function jump!(r::RandomNumbers.Xorshifts.AbstractXoroshiro128)
#static const uint64_t JUMP[] = { 0xdf900294d8f554a5, 0x170865df4b3201fc };
s0 = UInt64(0)
s1 = UInt64(0)
for i=0:1
#for(int i = 0; i < sizeof JUMP / sizeof *JUMP; i++)
if i==0
v=0xdf900294d8f554a5
else
v=0x170865df4b3201fc
end
for b=0:64-1
if !(iszero(v & UInt64(1) << b)) #(JUMP[i] & UINT64_C(1) << b)
#Bitwise exclusive OR and assignment operator. C ^= 2 is same as C = C ^ 2
@inbounds s0=xor(s0,r.x) #s0 ^= s[0]; #s0=s0^s[0]
@inbounds s1=xor(s1,r.y) #s1 ^= s[1]; #s1=s1^s[1]
end
RandomNumbers.Xorshifts.xorshift_next(r)
end
r.x = s0;
r.y = s1;
end
nothing
end
From http://xoroshiro.di.unimi.it
Would it be possible to implement jump functions in this package?
This seems like a nice addition for parallel usage.
The text was updated successfully, but these errors were encountered: