summaryrefslogtreecommitdiff
path: root/numpy/random
diff options
context:
space:
mode:
authorRobert Kern <robert.kern@gmail.com>2019-06-28 21:11:53 -0700
committerRobert Kern <robert.kern@gmail.com>2019-06-28 21:11:53 -0700
commita1c1d289c1e2c4effb073d895c827b18ad5934e2 (patch)
tree661ed1ee72d1bd3fa636b08c25e0b050458accb8 /numpy/random
parent59ebfbbe32bcac4a278c39a9a24b80a42d47a8f6 (diff)
downloadnumpy-a1c1d289c1e2c4effb073d895c827b18ad5934e2.tar.gz
DOC: Document the precise PCG variant.
Also, turn some of the reference URLs into links.
Diffstat (limited to 'numpy/random')
-rw-r--r--numpy/random/pcg64.pyx13
-rw-r--r--numpy/random/sfc64.pyx8
2 files changed, 13 insertions, 8 deletions
diff --git a/numpy/random/pcg64.pyx b/numpy/random/pcg64.pyx
index c07ec09cb..585520139 100644
--- a/numpy/random/pcg64.pyx
+++ b/numpy/random/pcg64.pyx
@@ -56,6 +56,8 @@ cdef class PCG64(BitGenerator):
PCG-64 is a 128-bit implementation of O'Neill's permutation congruential
generator ([1]_, [2]_). PCG-64 has a period of :math:`2^{128}` and supports
advancing an arbitrary number of steps as well as :math:`2^{127}` streams.
+ The specific member of the PCG family that we use is PCG XSL RR 128/64
+ as described in the paper ([2]_).
``PCG64`` provides a capsule containing function pointers that produce
doubles, and unsigned 32 and 64- bit integers. These are not
@@ -93,10 +95,11 @@ cdef class PCG64(BitGenerator):
References
----------
- .. [1] "PCG, A Family of Better Random Number Generators",
- http://www.pcg-random.org/
- .. [2] O'Neill, Melissa E. "PCG: A Family of Simple Fast Space-Efficient
+ .. [1] `"PCG, A Family of Better Random Number Generators"
+ <http://www.pcg-random.org/>`_
+ .. [2] O'Neill, Melissa E. `"PCG: A Family of Simple Fast Space-Efficient
Statistically Good Algorithms for Random Number Generation"
+ <https://www.cs.hmc.edu/tr/hmc-cs-2014-0905.pdf>`_
"""
cdef pcg64_state rng_state
@@ -143,7 +146,9 @@ cdef class PCG64(BitGenerator):
def jumped(self, jumps=1):
"""
jumped(jumps=1)
- Returns a new bit generator with the state jumped
+
+ Returns a new bit generator with the state jumped.
+
Jumps the state as-if jumps * 210306068529402873165736369884012333109
random numbers have been generated.
diff --git a/numpy/random/sfc64.pyx b/numpy/random/sfc64.pyx
index 1afe3bd0d..a881096e9 100644
--- a/numpy/random/sfc64.pyx
+++ b/numpy/random/sfc64.pyx
@@ -76,10 +76,10 @@ cdef class SFC64(BitGenerator):
References
----------
- .. [1] "PractRand"
- http://pracrand.sourceforge.net/RNG_engines.txt
- .. [2] "Random Invertible Mapping Statistics",
- http://www.pcg-random.org/posts/random-invertible-mapping-statistics.html
+ .. [1] `"PractRand"
+ <http://pracrand.sourceforge.net/RNG_engines.txt>`_
+ .. [2] `"Random Invertible Mapping Statistics"
+ <http://www.pcg-random.org/posts/random-invertible-mapping-statistics.html>`_
"""
cdef sfc64_state rng_state