I have some C++ code that I need to access from Python. I don't need to access any classes or anything, just a couple of functions that take one array as input and produce another array as output. The sizes of the arrays are known beforehand if that's any help.
So the functions are of the form
Expand|Select|Wrap|Line Numbers
- double *foo(double *in, int size);
I've looked at SWIG and managed to create some wrappers for simple test functions, but handling arrays turned out to be more difficult. I've succeeded in passing arrays to the functions (both using carrays.i and numpy.i typedefs), but I can't figure out how to pass arrays as output.
So now I'm asking, what would be the quickest, easiest way to get this to work? Is SWIG the way to go, or should I look at Cython or Pyrex? If someone could provide or point me to some working example code for doing this I would be forever grateful! Surely someone must have tried to do this before.