[Cython] Cython and numpy question(s)

evlutte at gmail.com evlutte at gmail.com
Fri Jun 26 19:59:02 CEST 2009


I'm working on a module that will hopefully eventually go to the SAGE  
project. Here's a snippet of code:


import numpy as np
cimport numpy as np
import math
#cimport math
import cmath
#cimport cmath
from math import pi
from cmath import exp

cdef double PI = pi
cdef double TWOPI = 2*PI
cdef I = complex(0,1)

class Riemann_Map():

def __init__(self,f,fprime,a,N, init_full = False):
self.a = a
self.N = N
self.tk = np.array(np.arange(N)*TWOPI/N, dtype = np.float64)
cdef np.ndarray[np.complex128, ndim = 1] cp = np.zeros(N,dtype =  
np.complex128)

As far as I can tell from the cython/numpy tutorial, that last line should  
be legit, but I get this error:
"complex128 is not a type identifier"

Because I'm just learning cython, I'll probably be coming back with more  
questions.

Thanks for any help you can provide,

Ethan Van Andel
Because I'm ver
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codespeak.net/pipermail/cython-dev/attachments/20090626/fbf448a7/attachment-0001.htm 


More information about the Cython-dev mailing list