@@ -14,15 +14,13 @@ from cython cimport floating
14
14
import warnings
15
15
from ..exceptions import ConvergenceWarning
16
16
17
- from ..utils._cython_blas cimport (_axpy, _dot, _asum, _gemv, _nrm2,
18
- _copy, _scal)
17
+ from ..utils._cython_blas cimport (
18
+ _axpy, _dot, _asum, _gemv, _nrm2, _copy, _scal
19
+ )
19
20
from ..utils._cython_blas cimport ColMajor, Trans, NoTrans
20
-
21
-
21
+ from ..utils._typedefs cimport uint32_t
22
22
from ..utils._random cimport our_rand_r
23
23
24
- ctypedef cnp.float64_t DOUBLE
25
- ctypedef cnp.uint32_t UINT32_t
26
24
27
25
cnp.import_array()
28
26
@@ -37,7 +35,7 @@ cdef enum:
37
35
RAND_R_MAX = 2147483647
38
36
39
37
40
- cdef inline UINT32_t rand_int(UINT32_t end, UINT32_t * random_state) noexcept nogil:
38
+ cdef inline uint32_t rand_int(uint32_t end, uint32_t * random_state) noexcept nogil:
41
39
""" Generate a random integer in [0; end)."""
42
40
return our_rand_r(random_state) % end
43
41
@@ -156,8 +154,8 @@ def enet_coordinate_descent(
156
154
cdef unsigned int ii
157
155
cdef unsigned int n_iter = 0
158
156
cdef unsigned int f_iter
159
- cdef UINT32_t rand_r_state_seed = rng.randint(0 , RAND_R_MAX)
160
- cdef UINT32_t * rand_r_state = & rand_r_state_seed
157
+ cdef uint32_t rand_r_state_seed = rng.randint(0 , RAND_R_MAX)
158
+ cdef uint32_t * rand_r_state = & rand_r_state_seed
161
159
162
160
if alpha == 0 and beta == 0 :
163
161
warnings.warn(" Coordinate descent with no regularization may lead to "
@@ -370,8 +368,8 @@ def sparse_enet_coordinate_descent(
370
368
cdef unsigned int jj
371
369
cdef unsigned int n_iter = 0
372
370
cdef unsigned int f_iter
373
- cdef UINT32_t rand_r_state_seed = rng.randint(0 , RAND_R_MAX)
374
- cdef UINT32_t * rand_r_state = & rand_r_state_seed
371
+ cdef uint32_t rand_r_state_seed = rng.randint(0 , RAND_R_MAX)
372
+ cdef uint32_t * rand_r_state = & rand_r_state_seed
375
373
cdef bint center = False
376
374
cdef bint no_sample_weights = sample_weight is None
377
375
cdef int kk
@@ -628,8 +626,8 @@ def enet_coordinate_descent_gram(
628
626
cdef unsigned int ii
629
627
cdef unsigned int n_iter = 0
630
628
cdef unsigned int f_iter
631
- cdef UINT32_t rand_r_state_seed = rng.randint(0 , RAND_R_MAX)
632
- cdef UINT32_t * rand_r_state = & rand_r_state_seed
629
+ cdef uint32_t rand_r_state_seed = rng.randint(0 , RAND_R_MAX)
630
+ cdef uint32_t * rand_r_state = & rand_r_state_seed
633
631
634
632
cdef floating y_norm2 = np.dot(y, y)
635
633
cdef floating* w_ptr = & w[0 ]
@@ -808,8 +806,8 @@ def enet_coordinate_descent_multi_task(
808
806
cdef unsigned int jj
809
807
cdef unsigned int n_iter = 0
810
808
cdef unsigned int f_iter
811
- cdef UINT32_t rand_r_state_seed = rng.randint(0 , RAND_R_MAX)
812
- cdef UINT32_t * rand_r_state = & rand_r_state_seed
809
+ cdef uint32_t rand_r_state_seed = rng.randint(0 , RAND_R_MAX)
810
+ cdef uint32_t * rand_r_state = & rand_r_state_seed
813
811
814
812
cdef const floating* X_ptr = & X[0 , 0 ]
815
813
cdef const floating* Y_ptr = & Y[0 , 0 ]
0 commit comments