Skip to content

Commit d34f856

Browse files
oscardssmithrfourquetvtjnashViralBShah
authored andcommitted
Clarify AbstractRNG documentation (JuliaLang#41875)
* Clarify AbstractRNG documentation clean up the section a bit. * make the exported types a bulleted list * point out that `MersenneTwister` shouldn't be used except for backwards compatability * explicitly mention `DeviceRandom` is what to use as a secure random generator. * Update stdlib/Random/docs/src/index.md Co-authored-by: Rafael Fourquet <[email protected]> * Update stdlib/Random/docs/src/index.md Co-authored-by: Jameson Nash <[email protected]> * Update stdlib/Random/docs/src/index.md Co-authored-by: Jameson Nash <[email protected]> * Update stdlib/Random/docs/src/index.md Co-authored-by: Jameson Nash <[email protected]> * Update stdlib/Random/docs/src/index.md Co-authored-by: Rafael Fourquet <[email protected]> * Update stdlib/Random/docs/src/index.md Co-authored-by: Jameson Nash <[email protected]> * Update stdlib/Random/docs/src/index.md Co-authored-by: Jameson Nash <[email protected]> Co-authored-by: Rafael Fourquet <[email protected]> Co-authored-by: Jameson Nash <[email protected]> Co-authored-by: Viral B. Shah <[email protected]>
1 parent 3254676 commit d34f856

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

stdlib/Random/docs/src/index.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ Random number generation in Julia uses the [Xoshiro256++](https://prng.di.unimi.
88
by default, with per-`Task` state.
99
Other RNG types can be plugged in by inheriting the `AbstractRNG` type; they can then be used to
1010
obtain multiple streams of random numbers.
11-
Besides the default `TaskLocalRNG` type, the `Random` package also provides `MersenneTwister`,
12-
`RandomDevice` (which exposes OS-provided entropy), and `Xoshiro` (for explicitly-managed
13-
Xoshiro256++ streams).
11+
12+
The PRNGs (pseudorandom number generators) exported by the `Random` package are:
13+
* `TaskLocalRNG`: a token that represents use of the currently active Task-local stream, deterministically seeded from the parent task, or by `RandomDevice` (with system randomness) at program start
14+
* `Xoshiro`: generates a high-quality stream of random numbers with a small state vector and high performance using the Xoshiro256++ algorithm
15+
* `RandomDevice`: for OS-provided entropy. This may be used for cryptographically secure random numbers (CS(P)RNG).
16+
* `MersenneTwister`: an alternate high-quality PRNG which was the default in older versions of Julia, and is also quite fast, but requires much more space to store the state vector and generate a random sequence.
1417

1518
Most functions related to random generation accept an optional `AbstractRNG` object as first argument.
1619
Some also accept dimension specifications `dims...` (which can also be given as a tuple) to generate

0 commit comments

Comments
 (0)