-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
widen signature of randn!(::MersenneTwister, ::Array{Float64}) ? #49388
Comments
Using |
the fallback method, which inputs |
that's bad. We should fix that. |
The risk is still there - another method having that same problem doesn't make it any more safe to do. |
I personally think it's better to use |
why should this performance optimization not include all
AbstractArrays{Float64}
s ? i haven't tested any changes to the Random stdlib, but simply looking at the code i think it should work forAbstractArray
s too, like this:randfun!(rng::MersenneTwister, A::AbstractArray{Float64})
.the reason i ask, is that for testing purposes i need to generate the same random numbers with and without physical units using Unitful.jl. to do so, one currently must strip off the units using
ustrip
, which usesreinterpret
, and hence returns aReinterpretArray
, which then dispatches to the non-optimized code, leading to different random numbers.cc: @rfourquet
The text was updated successfully, but these errors were encountered: