bit_generator.pxd 1.2 KB

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