-
Notifications
You must be signed in to change notification settings - Fork 329
Upgrade to rand 0.7.0 #659
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
Merged
Merged
Changes from 20 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
b5da271
upgrade to rand 0.7.0
max-sixty 4753c28
Merge branch 'master' into rand-0.7.0
max-sixty fd307be
move benches to rand_distr
max-sixty b530246
upgrade rand in numeric-tests too
max-sixty 1c4bf65
not sure why we need extern crate but it seems we do?!
max-sixty 1462c5e
cargo fmt
max-sixty 4254365
move distributions to rand_distr
max-sixty 9e934ed
Normal now returns Result
max-sixty 717d942
bump ndarray-rand to 0.10.0
max-sixty 00a6619
bump required rust to 1.32 because of getrandom
max-sixty fd44cba
Merge branch 'master' into rand-0.7.0
max-sixty 702b3a6
Merge branch 'master' into rand-0.7.0
max-sixty 0ae3788
rand_distr to dev dependencies
max-sixty 0291f30
bump version, add note to readme
max-sixty b48bb4a
update benches
max-sixty 2b8fe68
fix ndarray-rand edition idioms
max-sixty 61884d4
cargo fmt after cargo fix
max-sixty d81407f
note in lib.rs
max-sixty 0fc7047
Improve formatting
jturner314 ec8af57
Mention Rust 1.32 in ndarray-rand changelog
jturner314 1f6e9f8
Merge branch 'master' into rand-0.7.0
max-sixty f6a68d4
Merge branch 'master' into rand-0.7.0
max-sixty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,29 @@ | ||
#![feature(test)] | ||
|
||
extern crate ndarray; | ||
extern crate ndarray_rand; | ||
extern crate rand; | ||
extern crate test; | ||
|
||
use ndarray::Array; | ||
use ndarray_rand::RandomExt; | ||
use ndarray_rand::F32; | ||
use rand::distributions::Normal; | ||
use rand::distributions::Uniform; | ||
use rand_distr::Normal; | ||
use rand_distr::Uniform; | ||
|
||
use test::Bencher; | ||
|
||
#[bench] | ||
fn uniform_f32(b: &mut Bencher) { | ||
let m = 100; | ||
b.iter(|| { | ||
let a = Array::random((m, m), Uniform::new(-1f32, 1.)); | ||
a | ||
}); | ||
b.iter(|| Array::random((m, m), Uniform::new(-1f32, 1.))); | ||
} | ||
|
||
#[bench] | ||
fn norm_f32(b: &mut Bencher) { | ||
let m = 100; | ||
b.iter(|| { | ||
let a = Array::random((m, m), F32(Normal::new(0., 1.))); | ||
a | ||
}); | ||
b.iter(|| Array::random((m, m), F32(Normal::new(0., 1.).unwrap()))); | ||
} | ||
|
||
#[bench] | ||
fn norm_f64(b: &mut Bencher) { | ||
let m = 100; | ||
b.iter(|| { | ||
let a = Array::random((m, m), Normal::new(0., 1.)); | ||
a | ||
}); | ||
b.iter(|| Array::random((m, m), Normal::new(0., 1.).unwrap())); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.