Skip to content
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

Adds AbstractRNG to various methods which utilise rand. #10349

Merged
merged 1 commit into from
Mar 15, 2015

Conversation

simonbyrne
Copy link
Contributor

Partially fixes #10345. Also utilise randexp in randsubseq instead of taking log of rand. I had to move some methods around so that AbstractRNG would be defined when they were parsed.

Remaining methods which call rand without an AbstractRNG argument are

  • sprand: this is a bit complicated, as it accepts an optional functional argument for generating the values. now done.
  • SharedArray and DArray methods: I don't understand these well enough to know how they interact with the RNG
  • mktempdir in file.jl (windows only).
  • peakflops in linalg/generic.jl

@simonbyrne simonbyrne added the domain:randomness Random number generation and the Random stdlib label Feb 27, 2015
@ivarne
Copy link
Sponsor Member

ivarne commented Feb 27, 2015

DArray seems to be moving (#10334), so a PR to fix the RNG for them should probably go to https://github.com/JuliaParallel/DistributedArrays.jl

mktempdir does uses OS functionality on Unix, so I think relying on the global RNG is fine.

CC: @rfourquet

@simonbyrne
Copy link
Contributor Author

Yeah, I don't think we need to worry about mktempdir or peakflops.

@simonbyrne simonbyrne force-pushed the randarg branch 2 times, most recently from f2603ce to f158d80 Compare March 10, 2015 10:06
@simonbyrne
Copy link
Contributor Author

Okay, I've added some tests, and updated sprand. I think this is ready to go: I think the shared matrix methods can wait until we have a clearer idea of what we're doing with those.

@ViralBShah
Copy link
Member

I am ok with this. SharedArray will probably go into a package later on, once we have multi-threading.

ViralBShah pushed a commit that referenced this pull request Mar 10, 2015
Add an assertion for correctness too.
Address #10349
simonbyrne added a commit that referenced this pull request Mar 15, 2015
Adds AbstractRNG to various methods which utilise rand.
@simonbyrne simonbyrne merged commit 76e8f3d into JuliaLang:master Mar 15, 2015
@simonbyrne simonbyrne deleted the randarg branch March 15, 2015 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:randomness Random number generation and the Random stdlib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

overloads for combinatorics.jl methods that accept rng's as parameters
3 participants