@@ -25,7 +25,7 @@ cdef extern from "distributions.h":
25
25
26
26
cdef void set_seed(aug_state* state, uint64_t seed, uint64_t inc)
27
27
28
- cdef void advance (aug_state* state, uint64_t delta)
28
+ cdef void advance_state (aug_state* state, uint64_t delta)
29
29
30
30
ctypedef uint64_t rng_state_t
31
31
@@ -55,7 +55,8 @@ value is generated and returned. If `size` is an integer, then a 1-D
55
55
array filled with generated values is returned. If `size` is a tuple,
56
56
then an array with that shape is filled and returned.
57
57
58
- *No Compatibility Guarantee*
58
+ **No Compatibility Guarantee**
59
+
59
60
``pcg32.RandomState`` does not make a guarantee that a fixed seed and a
60
61
fixed series of calls to ``pcg32.RandomState`` methods using the same
61
62
parameters will always produce the same results. This is different from
@@ -84,6 +85,26 @@ The state of the PCG-32 PRNG is represented by 2 64-bit unsigned integers.
84
85
85
86
See pcg64 for a similar implementation with a larger period.
86
87
88
+ ** Parallel Features **
89
+
90
+ ``pcg32.RandomState`` can be used in parallel applications in one of two ways.
91
+ The preferable method is to use sub-streams, which are generated by using the
92
+ same value in the first position of the seed and incrementing the second value.
93
+
94
+ >>> import randomstate.prng.pcg32 as rnd
95
+ >>> rs = [rng.RandomState(1234, i + 1) for i in range(10)]
96
+
97
+ The alternative method is to use a single RandomState and advance to get
98
+ non-overlapping sequences.
99
+
100
+ >>> import randomstate.prng.pcg32 as rnd
101
+ >>> rs = [rng.RandomState(1234, 1) for _ in range(10)]
102
+ >>> for i in range(10):
103
+ rs[i].advance(2**32)
104
+
105
+ *Note*: Due to the limited period of ``pcg32.RandomState`` using ``advance``
106
+ in parallel applications is not recommended.
107
+
87
108
References
88
109
----------
89
110
.. [1] "PCG, A Family of Better Random Number Generators",
0 commit comments