@@ -42,13 +42,13 @@ cdef extern from "f2py/f2pyptr.h":
4242 void * f2py_pointer(object ) except NULL
4343
4444ctypedef double d
45- ctypedef int dgemm_t(char * transa, char * transb, int * m, int * n, int * k, d * alpha, d * a,
46- int * lda, d * b, int * ldb, d * beta, d * c, int * ldc) nogil
47- ctypedef int dgemv_t(char * transa, int * m, int * n, d * alpha, d * a,
48- int * lda, d * x, int * incx, d * beta, d * y, int * incy) nogil
49- ctypedef d ddot_t(int * n, d * dx, int * incx, d * dy, int * incy) nogil
50- ctypedef d dnrm2_t(int * n, d * x, int * incx) nogil
51- ctypedef int daxpy_t(int * n, d * alpha, d * x, int * incx, d * y, int * incy) nogil
45+ ctypedef int dgemm_t(char * transa, char * transb, int * m, int * n, int * k, d * alpha, const d * a,
46+ int * lda, const d * b, int * ldb, d * beta, d * c, int * ldc) nogil
47+ ctypedef int dgemv_t(char * transa, int * m, int * n, d * alpha, const d * a,
48+ int * lda, const d * x, int * incx, d * beta, d * y, int * incy) nogil
49+ ctypedef d ddot_t(int * n, const d * dx, int * incx, const d * dy, int * incy) nogil
50+ ctypedef d dnrm2_t(int * n, const d * x, int * incx) nogil
51+ ctypedef int daxpy_t(int * n, const d * alpha, const d * x, int * incx, d * y, int * incy) nogil
5252ctypedef int dger_t(int * n, int * m, d * alpha, d * x, int * incx, d * y, int * incy, d * a, int * lda) nogil
5353
5454cdef dgemm_t * FORTRAN_DGEMM = < dgemm_t* > f2py_pointer(blas.dgemm._cpointer)
@@ -60,7 +60,7 @@ cdef dger_t *FORTRAN_DGER = <dger_t*>f2py_pointer(blas.dger._cpointer)
6060
6161
6262@ cython.boundscheck (False )
63- cdef inline int cdgemm_NN(double [:, ::1 ] a, double [:, ::1 ] b, double [:, ::1 ] c, double alpha = 1.0 , double beta = 0.0 ) nogil:
63+ cdef inline int cdgemm_NN(const double [:, ::1 ] a, const double [:, ::1 ] b, double [:, ::1 ] c, double alpha = 1.0 , double beta = 0.0 ) nogil:
6464 """ c = beta*c + alpha*dot(a, b)
6565 """
6666 cdef int m, k, n
@@ -75,7 +75,7 @@ cdef inline int cdgemm_NN(double[:, ::1] a, double[:, ::1] b, double[:, ::1] c,
7575
7676
7777@ cython.boundscheck (False )
78- cdef inline int cdgemm_NT(double [:, ::1 ] a, double [:, ::1 ] b, double [:, ::1 ] c, double alpha = 1.0 , double beta = 0.0 ) nogil:
78+ cdef inline int cdgemm_NT(const double [:, ::1 ] a, const double [:, ::1 ] b, double [:, ::1 ] c, double alpha = 1.0 , double beta = 0.0 ) nogil:
7979 """ c = beta*c + alpha*dot(a, b.T)
8080 """
8181 cdef int m, k, n
@@ -90,7 +90,7 @@ cdef inline int cdgemm_NT(double[:, ::1] a, double[:, ::1] b, double[:, ::1] c,
9090
9191
9292@ cython.boundscheck (False )
93- cdef inline int cdgemm_TN(double [:, ::1 ] a, double [:, ::1 ] b, double [:, ::1 ] c, double alpha = 1.0 , double beta = 0.0 ) nogil:
93+ cdef inline int cdgemm_TN(const double [:, ::1 ] a, const double [:, ::1 ] b, double [:, ::1 ] c, double alpha = 1.0 , double beta = 0.0 ) nogil:
9494 """ c = beta*c + alpha*dot(a.T, b)
9595 """
9696 cdef int m, k, n
@@ -105,7 +105,7 @@ cdef inline int cdgemm_TN(double[:, ::1] a, double[:, ::1] b, double[:, ::1] c,
105105
106106
107107@ cython.boundscheck (False )
108- cdef int cdgemv_N(double [:, ::1 ] a, double [:] x, double [:] y, double alpha = 1.0 , double beta = 0.0 ) nogil:
108+ cdef int cdgemv_N(const double [:, ::1 ] a, const double [:] x, double [:] y, double alpha = 1.0 , double beta = 0.0 ) nogil:
109109 cdef int m, n, incx, incy
110110 m = a.shape[0 ]
111111 n = a.shape[1 ]
@@ -119,7 +119,7 @@ cdef int cdgemv_N(double[:, ::1] a, double[:] x, double[:] y, double alpha=1.0,
119119
120120
121121@ cython.boundscheck (False )
122- cdef int cdgemv_T(double [:, ::1 ] a, double [:] x, double [:] y, double alpha = 1.0 , double beta = 0.0 ) nogil:
122+ cdef int cdgemv_T(const double [:, ::1 ] a, const double [:] x, double [:] y, double alpha = 1.0 , double beta = 0.0 ) nogil:
123123 cdef int m, n, incx, incy
124124 m = a.shape[1 ]
125125 n = a.shape[0 ]
@@ -133,7 +133,7 @@ cdef int cdgemv_T(double[:, ::1] a, double[:] x, double[:] y, double alpha=1.0,
133133
134134
135135@ cython.boundscheck (False )
136- cdef int cddot(double [:] x, double [:] y, double * result) nogil:
136+ cdef int cddot(const double [:] x, const double [:] y, double * result) nogil:
137137 cdef int n, incx, incy
138138 n = x.shape[0 ]
139139 incx = x.strides[0 ] / sizeof(double )
@@ -154,7 +154,7 @@ cdef int cdnrm2(double[:] x, double* result) nogil:
154154
155155
156156@ cython.boundscheck (False )
157- cdef int cdaxpy(double alpha, double [:] x, double [:] y) nogil:
157+ cdef int cdaxpy(double alpha, const double [:] x, double [:] y) nogil:
158158 cdef int n = x.shape[0 ]
159159 cdef int incx = x.strides[0 ] / sizeof(double )
160160 cdef int incy = y.strides[0 ] / sizeof(double )
0 commit comments