Hi Joaquim,

The *jumppoly* parameter to randjump is a string which depends on the 
specific parameters of the MersenneTwister. By default Julia uses the 19937 
parameters in SFMT. To calculate these strings a utility was (or is still) 
supplied with SFMT called calc-jump. Its homepage is 
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/JUMP/ . Compiling it 
is possible (I've managed to do so now), and then the command:
./calc-jump 100000000000000000000 poly.19937.txt
outputs the jumppoly used by Julia to setup multiple "independent" random 
generators (10^20 steps apart in the generator).
The smallest jump, by 1 step has the simple jumppoly equal to the string 
"2".
Finally, note that the Julia random generator can get two Float64s from 
each step of the Twister, and there is also a cache of about 382 Float64s, 
so jumping the Twister will not influence the generated random unless the 
cache is cleared and getting to the right position might require a *2 
somewhere.
To setup a fixed *jumppoly* parameter of your choice, you should be able to 
use calc-jump. To do it dynamically in Julia would require ccall-ing the 
SFMT routine in SFMT Jump which is not too hard as well.

G'day, Dan Getz
 
On Friday, October 21, 2016 at 3:43:05 AM UTC+3, Joaquim Masset Lacombe 
Dias Garcia wrote:
>
> Hi,
>
> Have anybody implemented an arbitrary jump ahead for Mersenne Twister in 
> julia?
>
> I saw that the randjump documentation that goes as following:
>
> randjump(*r::MersenneTwister*, *jumps*[, *jumppoly*]) → 
> Vector{MersenneTwister}
>
> Create an array of the size jumps of initialized MersenneTwister RNG 
> objects where the first RNG object given as a parameter and following 
> MersenneTwister RNGs in the array initialized such that a state of the 
> RNG object in the array would be moved forward (without generating numbers) 
> from a previous RNG object array element on a particular number of steps 
> encoded by the jump polynomial jumppoly
>
> Given that, my question would reduce to: how do I encode an arbitrary 
> number of step (N) in a *jumppoly* ?
>
> thanks!
>

Reply via email to