[SciPy-user] C/C++ extension with swig

Jaonary Rabarisoa jaonary at free.fr
Sat Dec 10 04:36:17 CST 2005


Hi all,

I'd like to write a python interface for some c/c++ code. I've  
already done this with the standard way (without swig) and now, I'd  
like to use swig.
The code that I like to wrap is like this :

	void (double *input, some other args, ...., double *output1, double  
*output2, ...)


The input and output arguments represent arrays (matirx, vectors, .nd- 
arrays, ...). In python, I'd like to passe the argument as a list (or  
scipy array) of the form

	[ [row1], .........., [rowN] ]

and so the outputs are.

My problem in the type mapping (Python -> C/C++ and C/C++ -> Python).  
I found in the swig documentation some hint about this but nowhere  
there are usefull information on how to use use scipy arrays without  
pain and transparently. I tryed to follow the example of  
scipy.cluster.vq but I doesn't work anymore. This issue is already  
mentionned here.


Thank you for your help




More information about the SciPy-user mailing list