[Numpy-discussion] NumPtr vs NumPy.i to access C

Jose Martin maitai02 at excite.com
Sun May 18 08:19:37 EDT 2008


Thanks everyone for all the comments! It helped to understand better the advantages/disadvantages of the various options to interact with C. 

Jose.


 --- On Sat 05/17, Bill Spotz < wfspotz at sandia.gov > wrote:

Just to make sure the original question gets answered, yes, numpy.i 
avoids copies as much as possible.

A special case is when your C code provides you with a view of its 
internal data and does not require any memory to be allocated by the 
(python) user. This can be dangerous, but if it is your use case, be 
sure to use the ARGOUTVIEW_* typemaps.

Oh, and Brian's description of SWIG is an eminently fair one.

AND, if NumPtr is only for Numeric, you should know that Numeric is no 
longer developed or supported.


_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!





More information about the NumPy-Discussion mailing list