@@ -16,10 +16,6 @@ ctypedef uint32_t (* random_uint_1_i_32)(aug_state* state, uint32_t a) nogil
16
16
ctypedef int32_t (* random_int_2_i_32)(aug_state* state, int32_t a, int32_t b) nogil
17
17
ctypedef int64_t (* random_int_2_i)(aug_state* state, int64_t a, int64_t b) nogil
18
18
19
- ctypedef void (* random_float_fill)(aug_state* state, np.npy_intp count, float * out) nogil
20
- ctypedef void (* random_double_fill)(aug_state* state, np.npy_intp count, double * out) nogil
21
-
22
-
23
19
cdef np.npy_intp compute_numel(size):
24
20
cdef np.npy_intp i, n = 1
25
21
if isinstance (size, tuple ):
@@ -600,40 +596,3 @@ cdef object disc(aug_state* state, void* func, object size, object lock,
600
596
return np.asarray(randoms).reshape(size)
601
597
602
598
603
- cdef object double_fill(aug_state* state, void * func, object size, object lock):
604
- cdef random_double_fill f = < random_double_fill> func
605
- cdef double out
606
- cdef double * out_array_data
607
- cdef np.ndarray out_array
608
- cdef np.npy_intp n
609
-
610
- if size is None :
611
- with lock:
612
- f(state, 1 , & out)
613
- return out
614
- else :
615
- out_array = < np.ndarray> np.empty(size, np.float64)
616
- n = np.PyArray_SIZE(out_array)
617
- out_array_data = < double * > np.PyArray_DATA(out_array)
618
- with lock, nogil:
619
- f(state, n, out_array_data)
620
- return out_array
621
-
622
- cdef object float_fill(aug_state* state, void * func, object size, object lock):
623
- cdef random_float_fill f = < random_float_fill> func
624
- cdef float out
625
- cdef float * out_array_data
626
- cdef np.ndarray out_array
627
- cdef np.npy_intp n
628
-
629
- if size is None :
630
- with lock:
631
- f(state, 1 , & out)
632
- return out
633
- else :
634
- out_array = < np.ndarray> np.empty(size, np.float32)
635
- n = np.PyArray_SIZE(out_array)
636
- out_array_data = < float * > np.PyArray_DATA(out_array)
637
- with lock, nogil:
638
- f(state, n, out_array_data)
639
- return out_array
0 commit comments