JuliaSIMD / VectorizedRNG.jl

Vectorized uniform and normal random samplers.
MIT License
33 stars 7 forks source link

Not ultra random - seed not updating? #8

Closed richardreeve closed 4 years ago

richardreeve commented 4 years ago

There seems to be a problem if you ask for 1-4 random numbers that the seed doesn't update:

julia> using VectorizedRNG

julia> rand(local_rng(), 3)
3-element Array{Float64,1}:
 0.933187960601566
 0.21367553542309292
 0.29082002005103746

julia> rand(local_rng(), 3)
3-element Array{Float64,1}:
 0.933187960601566
 0.21367553542309292
 0.29082002005103746

You just always get the same numbers. Anything 5 and up works. I assume this isn't deliberate?

chriselrod commented 4 years ago

I assume this isn't deliberate?

Lol, no. I am not using this method. Fixed; I'll tag a new release as soon as tests pass.

julia> using VectorizedRNG

julia> rand(local_rng(), 3)
3-element Array{Float64,1}:
 0.696736586448424
 0.9260110816441399
 0.8988420256273512

julia> rand(local_rng(), 3)
3-element Array{Float64,1}:
 0.9716123502031692
 0.7087442810040175
 0.6577437662918132