diff options
author | Kevin Sheppard <kevin.k.sheppard@gmail.com> | 2019-05-23 15:28:22 +0100 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2019-05-27 22:58:35 +0300 |
commit | dabf42be29208a59bbacffd40d9d8dca6e200f49 (patch) | |
tree | 929ddc66702b257a8ffa372939d38bb42c041414 /numpy/random/examples/numba/extending_distributions.py | |
parent | 7c52c2810e20a9e483e564751b8e2342c97f56c2 (diff) | |
download | numpy-dabf42be29208a59bbacffd40d9d8dca6e200f49.tar.gz |
MAINT: Remove remnants of bit generators
Remove traces of the three removed bit generators
Add lock to Cython examples
Diffstat (limited to 'numpy/random/examples/numba/extending_distributions.py')
-rw-r--r-- | numpy/random/examples/numba/extending_distributions.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/numpy/random/examples/numba/extending_distributions.py b/numpy/random/examples/numba/extending_distributions.py index e1a57fa4f..f1f9003a9 100644 --- a/numpy/random/examples/numba/extending_distributions.py +++ b/numpy/random/examples/numba/extending_distributions.py @@ -5,8 +5,7 @@ export PYTHON_INCLUDE=#path to Python's include folder, usually \ ${PYTHON_HOME}/include/python${PYTHON_VERSION}m export NUMPY_INCLUDE=#path to numpy's include folder, usually \ ${PYTHON_HOME}/lib/python${PYTHON_VERSION}/site-packages/numpy/core/include -gcc -shared -o libdistributions.so -fPIC distributions.c -I${NUMPY_INCLUDE} \ - -I${PYTHON_INCLUDE} +gcc -shared -o libdistributions.so -fPIC distributions.c -I${NUMPY_INCLUDE} -I${PYTHON_INCLUDE} mv libdistributions.so ../../examples/numba/ On Windows @@ -24,7 +23,7 @@ import numba as nb import numpy as np from cffi import FFI -from randomgen import Xoroshiro128 +from numpy.random import Xoshiro256 ffi = FFI() if os.path.exists('./distributions.dll'): @@ -37,9 +36,9 @@ else: ffi.cdef(""" double random_gauss_zig(void *bitgen_state); """) -x = Xoroshiro128() +x = Xoshiro256() xffi = x.cffi -bit_generator = xffi.bitgen +bit_generator = xffi.bit_generator random_gauss_zig = lib.random_gauss_zig @@ -58,3 +57,4 @@ normalsj = nb.jit(normals, nopython=True) bit_generator_address = int(ffi.cast('uintptr_t', bit_generator)) norm = normalsj(1000, bit_generator_address) +print(norm[:12]) |