[Numpy-discussion] example of ufunc c-code?

Travis E. Oliphant oliphant at enthought.com
Thu Jan 10 09:27:18 EST 2008


Neal Becker wrote:
> Where can I find a (hopefully simple) example of c-code for a ufunc?
>
>   
Probably in scipy.special and or umathmodule.c in numpy/core/src.   The 
key is to register a 1-d "inner" loop that performs the basic 
calculation for a particular data-type.

You also need to provide the C-function and arrays that indicate the 
data-types that the C-function accepts to ufunc.

The umathmodule.c is harder to track because it is "auto-generated", so 
the scipy.special (cephesmodule.c) may be easier to understand.

Best regards,

-Travis O.




More information about the NumPy-Discussion mailing list