Diggory Hardy
f5185d91fa
thread_rng() → rand::rng() ( #1506 )
...
- Rename `rand::thread_rng()` → `rand::rng()`
- Remove `thread_rng()` and `random()` from the prelude
2024-10-11 08:51:21 +01:00
Arthur Silva
d1f961c4be
Improve SmallRng initialization performance ( #1482 )
2024-10-07 12:12:40 +01:00
Diggory Hardy
66b11eb17b
Rename gen_iter → random_iter, misc.. ( #1500 )
...
This extracts the non-inherent-methods stuff from #1492 .
2024-10-01 14:59:11 +01:00
Benjamin Lieser
e2092e9251
Poisson u64 sampling ( #1498 )
...
This addresses https://github.com/rust-random/rand/issues/1497 by adding
`Distribution<u64>`
It also solves https://github.com/rust-random/rand/issues/1312 by not
allowing `lambda` bigger than `1.844e19` (this also makes them always
fit into `u64`)
2024-10-01 14:27:39 +01:00
Diggory Hardy
ef052ec539
No usize except uniform ( #1487 )
...
- Add UniformUsize
- Support ..end and ..=ub range syntax for unsigned ints
2024-09-09 08:33:43 +01:00
Clar Fon
71c53be9a9
Require SeedableRng::Seed to impl Clone + AsRef ( #1491 )
2024-09-09 08:10:01 +01:00
Diggory Hardy
9e030aa221
Migrate remaining benchmarks to Criterion ( #1490 )
...
Translate everything still using the old test harness to Criterion.
2024-09-06 09:07:47 +01:00
Diggory Hardy
79f1b0ffdb
Document known issues: #1378 , #1312 , #1476 .
2024-08-12 12:16:08 +01:00
Bruce Mitchener
f7bbccaedf
Rename serde1
feature to serde
. ( #1477 )
2024-07-26 08:48:53 +01:00
Diggory Hardy
2d5948d264
rand::distributions -> distr; split uniform module ( #1470 )
2024-07-23 14:14:11 +01:00
Diggory Hardy
605476c4e4
Portability fixes ( #1469 )
...
- Fix portability of `choose_multiple_array`
- Fix portability of `rand::distributions::Slice`
2024-07-23 13:50:31 +01:00
Diggory Hardy
1e381d13ee
UniformFloat: allow inclusion of high in all cases ( #1462 )
...
Fix #1299 by removing logic specific to ensuring that we emulate a
closed range by excluding `high` from the result.
2024-07-16 11:32:06 +01:00
Diggory Hardy
ca9e119859
Add IndexedRandom::choose_multiple_array, index::sample_array ( #1453 )
...
* New private module rand::seq::iterator
* New private module rand::seq::slice
* Add index::sample_array and IndexedRandom::choose_multiple_array
2024-06-04 09:32:57 +01:00
Diggory Hardy
ba7f5155d3
Revise RNG docs; enable small_rng by default ( #1455 )
2024-05-23 14:12:08 +01:00
Joe Richey
e93776960e
Update Panic documentation and #[track_caller] ( #1447 )
...
This is stuff I missed in #1442
Signed-off-by: Joe Richey <joerichey@google.com>
Co-authored-by: Diggory Hardy <git@dhardy.name>
2024-05-08 14:30:08 +01:00
Joe Richey
a2375dceaf
Add #[track_caller] to methods which panic ( #1442 )
...
* Add #[track_caller] to methods which panic
This makes it easier to diagnose problems when the preconidtions of
these methods are not met.
Signed-off-by: Joe Richey <joerichey@google.com>
2024-05-05 08:19:29 +01:00
Vinzent Steinberg
4f8257a986
Rename Rng::gen
to Rng::random
( #1438 )
2024-04-29 19:41:10 +01:00
Diggory Hardy
75a233b02a
Add note to CHANGELOG
2024-04-27 09:06:46 +01:00
Michael Dyer
7b37c15cb7
Add methods weight, weights, and total_weight to weighted_index.rs ( #1420 )
2024-04-02 15:47:17 +01:00
Diggory Hardy
2eaf8545d4
Bump the MSRV to 1.61.0 ( #1416 )
2024-03-22 12:33:33 +00:00
Diggory Hardy
1015e709da
Prepare 0.9.0-alpha.1 ( #1413 )
2024-03-18 19:08:37 +00:00
Diggory Hardy
4cbbb340ad
Remove automatic (delayed) reseed-on-fork ( #1379 )
...
* benches/generators.rs: standardize thread_rng benchmarks
* Remove cfgs from examples
* Remove ReadRng
* Add ThreadRng::reseed and doc to use
* Remove fork protection from ReseedingRng; remove libc dep
* Enable ReseedingRng without std
* Move ReseedingRng up; remove module rand::rngs::adapter
2024-03-18 17:41:15 +00:00
acceptacross
4ed1b20be0
chore: fix typos ( #1407 )
...
Signed-off-by: acceptacross <csqcqs@gmail.com>
2024-03-11 10:56:13 +00:00
Justus Fluegel
7ed92ee278
Add .choices() method to the Slice distribution ( #1402 )
...
Signed-off-by: Justus Fluegel <justusfluegel@gmail.com>
2024-03-07 08:39:45 +00:00
Diggory Hardy
5577003615
Update CHANGELOGs and prepare rand 0.9.0-alpha.0 ( #1395 )
...
Also: add pull-request template
2024-02-18 17:02:05 +00:00
Diggory Hardy
22d0756b68
Uniform sampling: use Canon's method, Lemire's method ( #1287 )
...
Also:
* Add uniform distribution benchmarks
* Add "unbiased" feature flag
* Fix feature simd_support
* Uniform: impl PartialEq, Eq where possible
* CI: benches now require small_rng; build-test unbiased
2023-03-24 12:29:15 +00:00
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
Paul Crowley
e97b5b6887
Simpler and faster implementation of Floyd's F2 ( #1277 )
...
The previous implementation used either `Vec::insert` or a second
F-Y shuffling phase to achieve fair random order. Instead, use the
random numbers already drawn to achieve a fair shuffle.
2023-01-01 09:49:32 +00:00
Diggory Hardy
937320cbfe
Update CHANGELOG for 0.8.5 ( #1221 )
2022-02-14 08:37:01 +00:00
Vinzent Steinberg
90b89cdbb2
Merge branch 'master' into fix-unsafe-block
2021-09-12 16:44:52 +02:00
Vinzent Steinberg
da3b367d48
Merge branch 'fix-clippy' into fix-unsafe-block
2021-09-11 18:47:10 +02:00
Diggory Hardy
0435f0fff3
Update changelog
2021-09-11 16:55:53 +01:00
Vinzent Steinberg
b7380fde25
rand: Update changelog
2021-09-11 00:01:03 +02:00
Vinzent Steinberg
db6e81f34e
Bump versions
2021-08-19 20:49:50 +02:00
Vinzent Steinberg
536e18b0ea
rand: Update changelog
2021-08-19 20:45:09 +02:00
Vinzent Steinberg
1145ba0200
Update CHANGELOG.md
2021-07-13 15:23:39 +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
Adam Reichold
e0e13d79c6
Create a distribution by mapping the output of another one
...
This is useful if consumers are to be given an opaque type implementing the
Distribution trait, but the output of the provided implementations needs
additional post processing, e.g. to attach compile time units of measurement.
2021-05-23 18:42:18 +02:00
Vinzent Steinberg
f14cdeac16
Update changelogs
2021-05-13 18:38:24 -03:00
Vinzent Steinberg
d86db46638
Merge branch 'master' into slice-distribution
2021-05-12 14:42:50 -03:00
Vinzent Steinberg
13949eeccd
Update changelog
2021-05-12 13:59:41 -03:00
Diggory Hardy
80172a2071
Changelog for #1104
2021-03-29 10:40:03 +01:00
Diggory Hardy
7b1b2d00b2
Update changelog
2021-03-29 09:48:30 +01:00
Diggory Hardy
8821743325
Prepare 0.8.3
2021-01-25 10:36:09 +00:00
Gautier Minster
2c9085a2de
Bump to 0.8.2 and update changelog
2021-01-13 01:16:20 +02:00
Taiki Endo
e5eec8e650
Prepare rand 0.8.1
2020-12-31 23:10:13 +09:00
Diggory Hardy
d109f1852f
Update changelog for rand v0.8
2020-12-18 15:26:35 +00:00
Diggory Hardy
491014be44
Prepare rand v0.8.0 release
2020-12-14 16:04:34 +00:00
Diggory Hardy
d8f4ec8e3a
Update changelog(s), esp. for rand_core v0.6
2020-10-27 22:10:42 +01:00