[Numpy-discussion] incorporating C/C++ code

Rob Hooft rob at hooft.net
Thu Jun 29 12:25:59 EDT 2006

Hash: SHA1

Joris De Ridder wrote:
> Hi,
> For heavy number crunching I would like to include C and/or C++ functions
> in my NumPy programs. They should have/give NumPy arrays as input/output. 
> On http://www.scipy.org/Topical_Software I find several suggestions to wrap
> C/C++ code: SWIG, weave, Pyrex, Instant, ... but it's quite difficult for me
> to have an idea which one I can/should use.
> So, a few questions:
> Any suggestion for which package I should use? Does this heavily depend
> for which purpose I want to use it?

Wrapping C/C++ code is only necessary if the C/C++ code is pre-existing.
I have thusfar only incorporated C code into Numeric python programs by
writing the code natively as a python extension.

Any kind of wrapping will carry a penalty. If you write a python
extension in C you have all the flexibility you need.

Rob Hooft

- --
Rob W.W. Hooft  ||  rob at hooft.net  ||  http://www.hooft.net/people/rob/
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the NumPy-Discussion mailing list