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

Travis E. Oliphant oliphant@enthought....
Thu Jan 10 08:27:18 CST 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