Greetings all,
Sorry for the incomplete message, I'm re-sending it.
I'm in need of fast computations on complex numbers from Cython. I've been
converting a Python groundwater flow model code to Cython, but I'm reaching
the point where I'd really prefer to have native C complex math. Up to now,
I've used some little C routines that I can call with multiple floats (the C
code converts to/from complex for my purposes). However, I'm nearly to the
point where I'll need to store series coefficients for performance purposes,
and then I'll either need to hide them in float arrays (and that's extremely
nasty), or something like that.
I'd like to say something like
cdef class Foo:
cdef cfloat z
def __cinit__(self, float x, float y):
self.z = cfloat(x, y)
cdef cfloat func(Foo self, float x, float y):
return-some-gnarly-function of x, y, and self.z
Or something like that, where 'cfloat' maps to the appropriate type in the C
compiler, e.g. "double _Complex" in gcc.
I've seen this discussed in the archives. Has it been implemented? Is there
some pre-release code that essentially works? I only need the four math
functions, conjugate, abs, and log.
THANKS! I think Cython will revolutionize my research work!
--vic
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev