[C++-sig] datastructure to numpy and back

Georg Holzmann grh at mur.at
Mon Oct 22 18:03:38 CEST 2007


Hallo!

> I've written a swig wrapper around a structure that could be used for 
> wrapping anything that needs to expose the __array_struct__ property 
> (didn't had the time to try Boost with Albert's wrappers). It is not 
> available on the net, but it is based on some mails that were sent here 
> and on the Pyrex example for the array interface.

Thanks, I looked now through quite some SWIG examples and I was able to 
get a matrix/array from numpy into C++ (with the very good documentated 
examples in numpy-svn/numpy/doc/swig).

However, I did not manage to get an array out of C++ to python without 
copying so far.
In the examples cited above it's only shown how to generate a new one 
dimensional array and return that.

Do you maybe have some links (from the mails here and on) where these 
features are explained ? Or modules which are examples for such use-cases ?

Thanks for any hint,
LG
Georg



More information about the Cplusplus-sig mailing list