Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 0a30b3a9f9f116957655e4520b1f2301 > files > 522

python-cython-0.19.1-4.mga4.x86_64.rpm

cimport numpy
import numpy

def sum_of_squares(numpy.ndarray[double, ndim=1] arr):
    cdef long N = arr.shape[0]
    cdef double ss = 0
    for i in range(N):
        ss += arr[i]**2
    return ss