[Numpy-discussion] Examples of basic C API usage?
Benjamin Thyreau
benjamin at decideur.info
Wed Aug 9 03:25:10 CDT 2006
Le Mardi 8 Août 2006 05:18, Bill Baxter a écrit :
> I see Pyrex and SWIG examples in numpy/doc but there doesn't seem to be an
> example of just a simple straightforward usage of the C-API.
> For instance make a few arrays by hand in C and then call numpy.multiply()
> on them. So far my attempts to call PyArray_SimpleNewFromData all result
> in segfaults.
> Anyone have such an example?
>
> --Bill
For our neuroimagery lib, i had to write some simples straightforward wrappers
to the C-lib GSL, which you might be interested to have a quick look..
Trac entry:
http://projects.scipy.org/neuroimaging/ni/browser/fff/trunk/bindings/lightwrappers.h
http://projects.scipy.org/neuroimaging/ni/browser/fff/trunk/bindings/lightwrappers.c
and half-commented example usage..
http://projects.scipy.org/neuroimaging/ni/browser/fff/trunk/pythonTests/fffctests/lightmoduleExample.c
--
Benjamin Thyreau
CEA Orsay
More information about the Numpy-discussion
mailing list