-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Re-export distribution trait and implemented dists * Export from the crate module * Adapt doc tests * Run cargo fmt * Re-export the whole rand crate. Adjust docs, readme and examples. * Refactor ndarray-rand readme and changelog. * Re-export rand-distr. Update docs accordingly. Add hyperlinks where helpful. * Keep stuff in sync * Update docs to use rand_distr * Add doc example to random_using with seedable rng (Isaac64) * Run cargo fmt * Remove extern crate from doc tests * Remove extern crate from README
- Loading branch information
1 parent
7d04eb7
commit a364cc8
Showing
6 changed files
with
174 additions
and
102 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
ndarray-rand | ||
============ | ||
|
||
Constructors for randomized arrays: `rand`'s integration with `ndarray`. | ||
|
||
Example | ||
======= | ||
|
||
Generate a 2-dimensional array with shape `(2,5)` and elements drawn from a uniform distribution | ||
over the `(0., 10.)` interval: | ||
|
||
```rust | ||
use ndarray::Array; | ||
use ndarray_rand::RandomExt; | ||
use ndarray_rand::rand_distr::Uniform; | ||
|
||
fn main() { | ||
let a = Array::random((2, 5), Uniform::new(0., 10.)); | ||
println!("{:8.4}", a); | ||
// Example Output: | ||
// [[ 8.6900, 6.9824, 3.8922, 6.5861, 2.4890], | ||
// [ 0.0914, 5.5186, 5.8135, 5.2361, 3.1879]] | ||
} | ||
``` | ||
|
||
Dependencies | ||
============ | ||
|
||
``ndarray-rand`` depends on ``rand`` 0.7. | ||
|
||
[`rand`](https://docs.rs/rand/0.7.0/rand/) and [`rand-distr`](https://docs.rs/rand_distr/0.2.1/rand_distr/) are | ||
re-exported as sub-modules, `ndarray_rand::rand` and `ndarray_rand::rand_distr` respectively. | ||
Please rely on these submodules for guaranteed version compatibility. | ||
|
||
If you want to use a random number generator or distribution from another crate | ||
with `ndarray-rand`, you need to make sure that the other crate also depends on the | ||
same version of `rand`. Otherwise, the compiler may return errors saying | ||
that the items are not compatible (e.g. that a type doesn't implement a | ||
necessary trait). | ||
|
||
Recent changes | ||
============== | ||
|
||
0.10.0 | ||
------ | ||
|
||
- Require `rand` 0.7 | ||
- Require Rust 1.32 or later | ||
- Re-export `rand` as a submodule, `ndarray_rand::rand` | ||
- Re-export `rand-distr` as a submodule, `ndarray_rand::rand_distr` | ||
|
||
Check _[Changelogs](https://github.com/rust-ndarray/ndarray/ndarray-rand/RELEASES.md)_ to see | ||
the changes introduced in previous releases. | ||
|
||
|
||
License | ||
======= | ||
|
||
Dual-licensed to be compatible with the Rust project. | ||
|
||
Licensed under the Apache License, Version 2.0 | ||
http://www.apache.org/licenses/LICENSE-2.0 or the MIT license | ||
http://opensource.org/licenses/MIT, at your | ||
option. This file may not be copied, modified, or distributed | ||
except according to those terms. |
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
Recent Changes | ||
-------------- | ||
|
||
- 0.10.0 | ||
|
||
- Require `rand` 0.7 | ||
- Require Rust 1.32 or later | ||
- Re-export `rand` as a submodule, `ndarray_rand::rand` | ||
- Re-export `rand-distr` as a submodule, `ndarray_rand::rand_distr` | ||
|
||
- 0.9.0 | ||
|
||
- Require rand 0.6 | ||
|
||
- 0.8.0 | ||
|
||
- Require ndarray 0.12 | ||
- Require rand 0.5 | ||
|
||
- 0.7.0 | ||
|
||
- Require ndarray 0.11 | ||
- Require rand 0.4 | ||
|
||
- 0.6.1 | ||
|
||
- Clean up implementation of ``Array::random`` by @v-shmyhlo | ||
|
||
- 0.6.0 | ||
|
||
- Require ndarray 0.10.0 | ||
|
||
- 0.5.0 | ||
|
||
- Require ndarray 0.9 | ||
|
||
- 0.4.0 | ||
|
||
- Require ndarray 0.8 | ||
|
||
- 0.3.0 | ||
|
||
- Require ndarray 0.7 | ||
|
||
- 0.2.0 | ||
|
||
- Require ndarray 0.6 | ||
|
||
- 0.1.0 | ||
|
||
- Initial release |
This file contains 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 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