Created
December 2, 2014 09:58
-
-
Save b-rodrigues/a5afbedb0deda6ba140b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
cimport numpy as np | |
cimport cython | |
@cython.boundscheck(False) | |
@cython.wraparound(False) | |
def my_cum_sum_memv(double[:, ::1] A, | |
double[:, ::1] B): | |
cdef int i, j, lA, lB | |
cdef float result = 0 | |
lA = len(A) | |
lB = len(B) | |
for i in range(0,lA): | |
for j in range(0,lB): | |
result = result + A[i,j] * B[i,j] | |
return(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment