codekingpro/portable-devtools
115k
1cimport numpy as np
2from libc.stdint cimport uint32_t, uint64_t
3
4cdef extern from "numpy/random/bitgen.h":
5 struct bitgen:
6 void *state
7 uint64_t (*next_uint64)(void *st) nogil
8 uint32_t (*next_uint32)(void *st) nogil
9 double (*next_double)(void *st) nogil
10 uint64_t (*next_raw)(void *st) nogil
11
12 ctypedef bitgen bitgen_t
13
14cdef class BitGenerator():
15 cdef readonly object _seed_seq
16 cdef readonly object lock
17 cdef bitgen_t _bitgen
18 cdef readonly object _ctypes
19 cdef readonly object _cffi
20 cdef readonly object capsule
21
22
23cdef class SeedSequence():
24 cdef readonly object entropy
25 cdef readonly tuple spawn_key
26 cdef readonly Py_ssize_t pool_size
27 cdef readonly object pool
28 cdef readonly uint32_t n_children_spawned
29
30 cdef mix_entropy(self, np.ndarray[np.npy_uint32, ndim=1] mixer,
31 np.ndarray[np.npy_uint32, ndim=1] entropy_array)
32 cdef get_assembled_entropy(self)
33
34cdef class SeedlessSeedSequence:
35 pass
36
37# NOTE: This has no implementation and should not be used. It purely exists for
38# backwards compatibility, see https://github.com/scipy/scipy/issues/24215.
39cdef class SeedlessSequence:
40 pass
41 