summaryrefslogtreecommitdiff
path: root/numpy/random/examples
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/random/examples')
-rw-r--r--numpy/random/examples/cython/extending.pyx6
-rw-r--r--numpy/random/examples/cython/extending_distributions.pyx6
-rw-r--r--numpy/random/examples/numba/extending.py6
-rw-r--r--numpy/random/examples/numba/extending_distributions.py4
4 files changed, 11 insertions, 11 deletions
diff --git a/numpy/random/examples/cython/extending.pyx b/numpy/random/examples/cython/extending.pyx
index b2418e93c..a6a4ba4bf 100644
--- a/numpy/random/examples/cython/extending.pyx
+++ b/numpy/random/examples/cython/extending.pyx
@@ -9,7 +9,7 @@ cimport numpy as np
cimport cython
from numpy.random.common cimport bitgen_t
-from numpy.random import Xoshiro256
+from numpy.random import PCG64
np.import_array()
@@ -23,7 +23,7 @@ def uniform_mean(Py_ssize_t n):
cdef double[::1] random_values
cdef np.ndarray randoms
- x = Xoshiro256()
+ x = PCG64()
capsule = x.capsule
if not PyCapsule_IsValid(capsule, capsule_name):
raise ValueError("Invalid pointer to anon_func_state")
@@ -64,7 +64,7 @@ def bounded_uints(uint32_t lb, uint32_t ub, Py_ssize_t n):
cdef uint32_t[::1] out
cdef const char *capsule_name = "BitGenerator"
- x = Xoshiro256()
+ x = PCG64()
out = np.empty(n, dtype=np.uint32)
capsule = x.capsule
diff --git a/numpy/random/examples/cython/extending_distributions.pyx b/numpy/random/examples/cython/extending_distributions.pyx
index 89477eb6d..3cefec97e 100644
--- a/numpy/random/examples/cython/extending_distributions.pyx
+++ b/numpy/random/examples/cython/extending_distributions.pyx
@@ -10,7 +10,7 @@ cimport cython
from cpython.pycapsule cimport PyCapsule_IsValid, PyCapsule_GetPointer
from numpy.random.common cimport *
from numpy.random.distributions cimport random_gauss_zig
-from numpy.random import Xoshiro256
+from numpy.random import PCG64
@cython.boundscheck(False)
@@ -21,7 +21,7 @@ def normals_zig(Py_ssize_t n):
cdef const char *capsule_name = "BitGenerator"
cdef double[::1] random_values
- x = Xoshiro256()
+ x = PCG64()
capsule = x.capsule
if not PyCapsule_IsValid(capsule, capsule_name):
raise ValueError("Invalid pointer to anon_func_state")
@@ -43,7 +43,7 @@ def uniforms(Py_ssize_t n):
cdef const char *capsule_name = "BitGenerator"
cdef double[::1] random_values
- x = Xoshiro256()
+ x = PCG64()
capsule = x.capsule
# Optional check that the capsule if from a BitGenerator
if not PyCapsule_IsValid(capsule, capsule_name):
diff --git a/numpy/random/examples/numba/extending.py b/numpy/random/examples/numba/extending.py
index a1a2b3d12..d41c2d76f 100644
--- a/numpy/random/examples/numba/extending.py
+++ b/numpy/random/examples/numba/extending.py
@@ -3,9 +3,9 @@ import datetime as dt
import numpy as np
import numba as nb
-from numpy.random import Xoshiro256
+from numpy.random import PCG64
-x = Xoshiro256()
+x = PCG64()
f = x.ctypes.next_uint32
s = x.ctypes.state
@@ -68,7 +68,7 @@ normalsj(1, state_addr)
start = dt.datetime.now()
normalsj(1000000, state_addr)
ms = 1000 * (dt.datetime.now() - start).total_seconds()
-print('1,000,000 Polar-transform (numba/Xoshiro256) randoms in '
+print('1,000,000 Polar-transform (numba/PCG64) randoms in '
'{ms:0.1f}ms'.format(ms=ms))
start = dt.datetime.now()
diff --git a/numpy/random/examples/numba/extending_distributions.py b/numpy/random/examples/numba/extending_distributions.py
index 1172e51de..9233ccced 100644
--- a/numpy/random/examples/numba/extending_distributions.py
+++ b/numpy/random/examples/numba/extending_distributions.py
@@ -24,7 +24,7 @@ import numba as nb
import numpy as np
from cffi import FFI
-from numpy.random import Xoshiro256
+from numpy.random import PCG64
ffi = FFI()
if os.path.exists('./distributions.dll'):
@@ -37,7 +37,7 @@ else:
ffi.cdef("""
double random_gauss_zig(void *bitgen_state);
""")
-x = Xoshiro256()
+x = PCG64()
xffi = x.cffi
bit_generator = xffi.bit_generator