On 2/3/12 1:37 AM, Oscar Lazo wrote:
Thank you all for your suggestions, which seem very good :). I was
away from the internet for most of today, so I couldn't read your
replies until now. I made a function called fast_complex which takes a
symbolic expression, generates the corresponding fortran code, and
compiles it using f2py. It seems fast enough for what I need, though I
wonder whether some of the suggestions here might be better. I'll post
the code:

Nice! I tried it (though I had to output the string and the copy and paste that into a %fortran cell), and the timings turned out between the two Cython versions.

The end result was that the straight Cython version was about 13.6 us, the expanded version (where e**(k*I) were precomputed) was about 9 us. The straight fortran version was 10.2 us, and the expanded fortran version (with the powers of e precomputed) was an amazing 3.26 us!

Jason

--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to