Examples of basic C API usage?
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
On Tuesday 08 of August 2006 05:18, Bill Baxter wrote:
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
Have you looked here? http://numeric.scipy.org/numpydoc/numpy-13.html#pgfId-36640 Karol -- written by Karol Langner wto sie 8 15:45:16 CEST 2006
Ah, great. That is helpful, though it does seem to be a bit outdated.
--bb
On 8/8/06, Karol Langner
On Tuesday 08 of August 2006 05:18, Bill Baxter wrote:
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
Have you looked here?
http://numeric.scipy.org/numpydoc/numpy-13.html#pgfId-36640
Karol
-- written by Karol Langner wto sie 8 15:45:16 CEST 2006
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion
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/lightwr... http://projects.scipy.org/neuroimaging/ni/browser/fff/trunk/bindings/lightwr... and half-commented example usage.. http://projects.scipy.org/neuroimaging/ni/browser/fff/trunk/pythonTests/fffc... -- Benjamin Thyreau CEA Orsay
participants (3)
-
Benjamin Thyreau
-
Bill Baxter
-
Karol Langner