|
4 | 4 | import numpy as np
|
5 | 5 | cimport numpy as np
|
6 | 6 |
|
7 |
| -from .distributions cimport * |
8 |
| - |
9 | 7 | __all__ = []
|
10 | 8 |
|
11 | 9 | np.import_array()
|
12 | 10 |
|
| 11 | +cdef extern from "include/distributions.h": |
| 12 | + # Generate random numbers in closed interval [off, off + rng]. |
| 13 | + uint64_t random_bounded_uint64(bitgen_t *bitgen_state, |
| 14 | + uint64_t off, uint64_t rng, |
| 15 | + uint64_t mask, bint use_masked) nogil |
| 16 | + uint32_t random_buffered_bounded_uint32(bitgen_t *bitgen_state, |
| 17 | + uint32_t off, uint32_t rng, |
| 18 | + uint32_t mask, bint use_masked, |
| 19 | + int *bcnt, uint32_t *buf) nogil |
| 20 | + uint16_t random_buffered_bounded_uint16(bitgen_t *bitgen_state, |
| 21 | + uint16_t off, uint16_t rng, |
| 22 | + uint16_t mask, bint use_masked, |
| 23 | + int *bcnt, uint32_t *buf) nogil |
| 24 | + uint8_t random_buffered_bounded_uint8(bitgen_t *bitgen_state, |
| 25 | + uint8_t off, uint8_t rng, |
| 26 | + uint8_t mask, bint use_masked, |
| 27 | + int *bcnt, uint32_t *buf) nogil |
| 28 | + np.npy_bool random_buffered_bounded_bool(bitgen_t *bitgen_state, |
| 29 | + np.npy_bool off, np.npy_bool rng, |
| 30 | + np.npy_bool mask, bint use_masked, |
| 31 | + int *bcnt, uint32_t *buf) nogil |
| 32 | + void random_bounded_uint64_fill(bitgen_t *bitgen_state, |
| 33 | + uint64_t off, uint64_t rng, np.npy_intp cnt, |
| 34 | + bint use_masked, |
| 35 | + uint64_t *out) nogil |
| 36 | + void random_bounded_uint32_fill(bitgen_t *bitgen_state, |
| 37 | + uint32_t off, uint32_t rng, np.npy_intp cnt, |
| 38 | + bint use_masked, |
| 39 | + uint32_t *out) nogil |
| 40 | + void random_bounded_uint16_fill(bitgen_t *bitgen_state, |
| 41 | + uint16_t off, uint16_t rng, np.npy_intp cnt, |
| 42 | + bint use_masked, |
| 43 | + uint16_t *out) nogil |
| 44 | + void random_bounded_uint8_fill(bitgen_t *bitgen_state, |
| 45 | + uint8_t off, uint8_t rng, np.npy_intp cnt, |
| 46 | + bint use_masked, |
| 47 | + uint8_t *out) nogil |
| 48 | + void random_bounded_bool_fill(bitgen_t *bitgen_state, |
| 49 | + np.npy_bool off, np.npy_bool rng, np.npy_intp cnt, |
| 50 | + bint use_masked, |
| 51 | + np.npy_bool *out) nogil |
| 52 | + |
| 53 | + |
| 54 | + |
13 | 55 | _integers_types = {'bool': (0, 2),
|
14 | 56 | 'int8': (-2**7, 2**7),
|
15 | 57 | 'int16': (-2**15, 2**15),
|
|
0 commit comments