[SciPy-dev] Combining Numpy/C/fortran ?

John Pye john at curioussymbols.com
Fri Mar 9 06:44:43 EST 2007


Maybe this is what you're looking for?
http://www.scipy.org/Cookbook/SWIG_and_NumPy

Cheers
JP

Pierre GM wrote:
> Folks,
> I'm trying to write an interface to numpy for a piece of mixed C/fortran code, 
> and I'm getting nowhere fast. 
>
> Roughly, the code is organized as such: a first C file defines some base 
> structures (involving long and double arrays) and initializes their members 
> by calling Fortran routines, either directly or through a set of C functions 
> defined in a second file. I need to get access to the initialized structures.
>
> I first started to get rid of the C structures by redefining them in Python, 
> so that I would only have to call functions with array arguments (and not 
> structures) and use f2py for the interface. However, this is not exactly a 
> bug-safe approach. The best would be to get an interface Python/C structure, 
> so that I could send ndarrays as inputs and get ndarrays as outputs.
>
> What is the easiest way to write such an interface ? 
>
> Thanks a lot for any idea...
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-dev
>   



More information about the SciPy-Dev mailing list