[Pythonmac-SIG] C Extension Scipy/Numpy

Zachary Pincus zachary.pincus at yale.edu
Thu Feb 25 22:20:24 CET 2010


Hi,

Probably better to:
(1) Ask this on the numpy mailing list, and
(2) Provide a complete, compilable example of the offending code.

Also, you may find it easier to write a pure-C routine and call into  
it using ctypes (getting pointers via numpy arrays' ctypes  
attributes), or alternately, use cython to write the routine.

Zach


On Feb 24, 2010, at 10:28 AM, brennsuppa wrote:

>
> Hi,
>
> I want to gain performance by using C for the computation of some  
> arrays.
> To do that I used this as a help:
> http://www.scipy.org/Cookbook/C_Extensions/NumPy_arrays
>
> Now I want to wirte a subroutine for the calculations with several  
> arrays.
> But I don't know how to pass the arrays to the subroutine.
>
> e.g. i have cin1, cin2, cin3, cin4 and cout
>
> cout = do_anything(cin1, cin2, cin3, cin4)
>
> and do_anything would be like:
>
> double **do_anything(cin1[][n], cin2[][n], cin3[][n], cin4[][n])
>
> for rows
> for columns
> add cin1,cin2,cin3,cin4
> return value
>
> this throws an error "conflicting types for do_anything"
>
> regards,
> joe
> -- 
> View this message in context: http://old.nabble.com/C-Extension-Scipy-Numpy-tp27714231p27714231.html
> Sent from the Python - pythonmac-sig mailing list archive at  
> Nabble.com.
>
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG at python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig
> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG



More information about the Pythonmac-SIG mailing list