[Numpy-discussion] C++ Example

Luis Pedro Coelho lpc at cmu.edu
Sun Mar 4 17:18:40 EST 2012


On Saturday, March 03, 2012 04:38:53 PM David Cournapeau wrote:
> I don't think the code is comparable either - some of the stuff done
> in the C code is done in the C++ code your are calling. The C code
> could be significantly improved.

Actually, that's not 100% accurate. The C code calls the same functions. Most 
of the extra cruft is that it needs to do all of this error checking and type-
dispatch, while in C++ you can have RAII and templates.

> Even more important here: almost none
> of this code should be written anymore anyway, C++ or not. This is
> really the kind of code that should be done in cython, as it is mostly
> about wrapping C code into the python C API.

At least last time I read up on it, cython was not able to do multi-type code, 
i.e., have code that works on arrays of multiple types. Does it support it 
now?

Best,
-- 
Luis Pedro Coelho | University of Lisbon | http://luispedro.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20120304/90238296/attachment.sig>


More information about the NumPy-Discussion mailing list