2009/3/22 Vic Kelson <[email protected]>: > (1) many of the fundamental analytic functions are already carefully coded > in Fortran 90 (no pointers) and can readily connect to Python via F2PY. I > don't want to re-code these because "they're both nasty" and coded using > complex arithmetic. So, my optimal Cython module should call some Fortran > routines.
As long as you add the nasty mangling underscores, you should be able to call Fortran functions from Cython. Complex type arguments would require a bit of manual code, as Cython do not (currently) handle complex C/C++ types. > (3) The "killer" feature that has stopped me from a Python computational > code is the ability to implement particle tracking in the model. The > tracking algorithm is computationally intensive, including checking for > intersections between line segments and proximity to model features. I > believe that Cython will allow me to overcome this hurdle. The test code I > mentioned above does not support this feature, but I will try to implement > it before PyCon. Let me tell you a story. A grad student doing some work with a coworker was coding Python for some computational geometry stuff, with GUI API´s, OpenGL and all that... But at some point, Python was a bit slow for managing some stuff, like "Point" classes. Then I told the guy: use Cython, just use "cdef" were appropriate (for the Point class and instance members), and the student got the code working with impressive speedups in a morning... So I bet you will not have any problems understanding and using Cython... -- Lisandro Dalcín --------------- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instituto de Desarrollo Tecnológico para la Industria Química (INTEC) Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET) PTLC - Güemes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594 _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
