[Numpy-discussion] C++ Example

Jeff Whitaker jswhit at fastmail.fm
Sun Mar 4 20:57:24 EST 2012


On 3/4/12 3:18 PM, Luis Pedro Coelho wrote:
> 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,
Coming soon in version 0.16:

https://sage.math.washington.edu:8091/hudson/job/cython-docs/doclinks/1/src/userguide/fusedtypes.html

-Jeff



More information about the NumPy-Discussion mailing list