For comparison of ctypes and SWIG wrappers of a simple C++ codebase, feel free to take a look at the code for scikits.ann (http://scipy.org/scipy/scikits/wiki/AnnWrapper). The original wrapper was written using SWIG and the numpy typemaps. Rob Hetland has coded an almost-the-same API wrapper using ctypes which is linked from the above wiki page. Perhaps it will help the OP to see a similar project side-by-side.
Barry On Feb 4, 2008 1:11 PM, Gael Varoquaux <[EMAIL PROTECTED]> wrote: > On Mon, Feb 04, 2008 at 12:49:58PM -0800, Lou Pecora wrote: > > So, for those looking for speed up through some > > external C or C++ code, I would say (trying to be fair > > here), try what Chris recommends below, if you want, > > but IMHO, none of it is trivial. If you get it to > > work, great. If not, you have the fall back of the C > > API. > > Honestly, I found ctypes trivial, using > http://www.scipy.org/Cookbook/Ctypes as a reference, and simply copying > the code. I started by copying the code, made sure it worked, and I > understood how to modify it, than adapted it to my problem. > > Gaƫl > > _______________________________________________ > Numpy-discussion mailing list > Numpy-discussion@scipy.org > http://projects.scipy.org/mailman/listinfo/numpy-discussion > _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion