60 Commits

Author SHA1 Message Date
Vinzent Steinberg
7d73990096
Make Uniform constructors return a result (#1229)
* Forbid unsafe code in crates without unsafe code

This helps tools like `cargo geiger`.

* Make `Uniform` constructors return a result

- This is a breaking change.
- The new error type had to be made public, otherwise `Uniform` could
  not be extended for user-defined types by implementing
  `UniformSampler`.
- `rand_distr` was updated accordingly.
- Also forbid unsafe code for crates where none is used.

Fixes #1195, #1211.

* Address review feedback
* Make `sample_single` return a `Result`
* Fix benchmarks
* Small fixes
* Update src/distributions/uniform.rs
2023-02-06 10:55:22 +00:00
Diggory Hardy
19169cbce9
Bump MSRV to 1.56 (Edition 2021) (#1269)
* Bump MSRV to 1.56 (Edition 2021)

* Apply Clippy suggestions

* Bump edition and add rust-version field to Cargo.toml

* CI AVR test: unpin nightly rust version

* Disable AVR test

* Bump crate version numbers for a breaking release
2022-12-06 19:01:10 +00:00
Diggory Hardy
9720f110a6
Update GitHub Actions (#1263)
* examples/rayon-monte-carlo.rs: remove execute bit of file metadata

* Document in README that MSRV is 1.51.0

This was changed in #1246

* Update GitHub Actions
2022-11-10 15:36:40 +00:00
Adam Reichold
6107f93e81 Apply the same copy-editing to the existing generators as was discussed for Lcg128CmDxsm64. 2021-12-06 13:35:29 +01:00
Adam Reichold
ece8e48905 Add Lcg128CmDxsm64 generator compatible with NumPy's PCG64DXSM. 2021-12-06 13:35:29 +01:00
Adam Reichold
b0d7833b55 Replace the open-coded fill_bytes_impl by rand_core::impls::fill_bytes_via_next. 2021-12-06 13:35:29 +01:00
Vinzent Steinberg
564055aed9 Remove notice by Apache License Authors for all other crates 2021-08-24 20:39:31 +02:00
Vinzent Steinberg
c60b7cd21b Remove special cases for emscripten
Because emscripten supports 128-bit integers now, we no longer have to
add special cases for it. In particular, we can now use ChaCha12 on all
platforms.
2021-07-08 16:29:02 +02:00
Dirk Stolle
277e5b0e9d fix some typos 2021-06-15 22:27:37 +02:00
Diggory Hardy
1bfc53d57f Update changelogs and bump version numbers 2021-06-14 10:04:59 +01:00
Vinzent Steinberg
9121d39732 Document dependencies between PCG streams
Fixes #907.
2021-05-07 18:33:06 -03:00
Mark Wong
57cd95999d Expand advancing tests to use multiple seeds 2021-04-22 16:32:08 -07:00
Mark Wong
c775705b88 Touch up changes around advancing feature
* Add additional comments on how to use the advance() function
* Use clone() for clarity instead of reusing a seed
* Compare the generator as a whole as opposed the next value in unit
  tests
2021-04-20 20:50:10 -07:00
Mark Wong
53b54b247e Fix Lcg64Xsh32 advancing test to use 32 bit generation functions 2021-04-19 14:12:23 -07:00
Mark Wong
f7960e9fb2 Revert "Delta needs to be doubled when advancing Lcg64Xsh32"
This reverts commit 624d24e8ae0043bfbd59c369e1741ab3bc848a64.
2021-04-19 14:00:18 -07:00
Mark Wong
624d24e8ae Delta needs to be doubled when advancing Lcg64Xsh32 2021-04-16 13:52:56 -07:00
Mark Wong
9017732011 Add tests for advancing PCG generators
A simple test to check the values after 20 steps.
2021-04-10 17:35:00 -07:00
Mark Wong
91d7699a69 Add an advance function to PCG generators
Based on the C implementations to advance the generator.
2021-04-04 09:48:43 -07:00
Diggory Hardy
1959b1adac Adjust homepage to point at the book 2020-12-15 10:13:17 +00:00
Diggory Hardy
e9adf451c5 Switch documentation links to docs.rs 2020-12-15 10:08:34 +00:00
Diggory Hardy
15aebf418f Prepare rand_pcg 0.3.0 2020-12-14 14:43:45 +00:00
Diggory Hardy
d95dbd2f93 Prepare rand_core 0.6.0 2020-12-14 14:43:45 +00:00
Diggory Hardy
0f53b56870 Update README files shields and doc 2020-12-13 11:00:07 +00:00
Diggory Hardy
8caa86b666 Cargo.toml: remove [badges] sections
According to the Cargo manifest, this section is not used
and the README should be used for build status.
2020-12-13 11:00:07 +00:00
Vinzent Steinberg
14ba1bbb4d Fix some clippy warnings
Also reenable some lints that no longer cause warnings.
2020-10-09 12:08:15 +02:00
Vinzent Steinberg
7555747c16 Bump MSRV to 1.36 2020-08-28 15:31:56 +02:00
Kaz Wesley
4b99567b56
impl PartialEq, Eq for rngs (#979)
Implements #974. As in #975, but defining equality such that the user is
not exposed to the fact that one logical state may have different
representations in an implementation-specific way.
2020-05-29 09:40:09 +01:00
Yannick Feld
bf8b5a98ac rand_pcg README.md Remove unnecessary [ 2020-04-29 13:58:01 +02:00
Diggory Hardy
3a5d5a8e7a Use rustfmt::skip for some cases
This does not include all cases of rejected reformatting;
only ones where rustfmt is not expected to do well.
2020-01-02 15:46:14 +00:00
Diggory Hardy
92e07018e0 rustfmt: expression spacing (on the line) 2020-01-02 15:46:14 +00:00
Diggory Hardy
fd872b66f1 rustfmt: arrays
(Several array reformattings were rejected.)
2020-01-02 15:46:14 +00:00
Diggory Hardy
363571540f rustfmt: method chaining 2020-01-02 15:46:14 +00:00
Diggory Hardy
4f1f0fce67 rustfmt: struct literals, if/for blocks 2020-01-02 15:46:14 +00:00
Diggory Hardy
ccb64dc0a0 rustfmt: attributes 2020-01-02 15:46:14 +00:00
Diggory Hardy
7a181deca6 rustfmt: initial attributes, mod and use statements 2020-01-02 15:46:14 +00:00
Diggory Hardy
88aa915c66 rustfmt: use, mod statements and initial attributes 2020-01-02 15:46:14 +00:00
Diggory Hardy
64045ff3f1 rand_pcg: doc fixes and extra links 2019-11-19 12:26:11 +00:00
Anthony Ramine
cfc68b5d09 Update rand_pcg to 0.2.1
This allows us to publish autocfg removal and bincode bump.
2019-10-22 17:26:51 +02:00
Diggory Hardy
33cd28b1c4 rand_pcg: bump bincode to 1.1.4 2019-09-20 21:20:53 +01:00
newpavlov
e02b467eca license field fixes 2019-08-08 11:44:35 +03:00
Vinzent Steinberg
1c516ebd66 rand_pcg: Replace transmutes with safe code 2019-07-09 14:10:45 +02:00
Vinzent Steinberg
78c470e5f3 rand_pcg: Fix clippy warnings 2019-07-09 14:08:57 +02:00
Vinzent Steinberg
8a2ee19e18 rand_pcg: Remove unused build dependency 2019-06-12 17:33:39 +02:00
Diggory Hardy
69912ea6c8 Require serde1 to enable serde support (reverts recent change) 2019-06-12 09:55:35 +01:00
Diggory Hardy
8dd020c537 Prepare rand_pcg 0.2.0 release 2019-06-11 13:29:59 +01:00
Diggory Hardy
18d55845ea rand_pcg: add Pcg64 RNG
Note: benchmarks now show different results to mentioned
for fill_bytes impl, possibly because of #[inline] changes
2019-06-11 13:29:21 +01:00
Diggory Hardy
fa26eb744e Use Edition 2018 in rand_pcg 2019-06-11 13:12:46 +01:00
Diggory Hardy
f92473ad1f Prepare rand_xorshift 0.1.2
Also patch two READMEs
2019-06-05 14:28:36 +01:00
Diggory Hardy
c1ba4210e8 Prepare rand_core 0.5 release 2019-06-05 14:27:45 +01:00
Diggory Hardy
67069d161c Bump MSRV to 1.32.0 2019-03-28 10:51:29 +00:00