my problem "should" be simple but I am still not able to solve it.
I am currently working on a project that requires some heavy computations (done in C++) and some post-simulations data analysis (done in Python).
However, now I am changing the main algorithm and I will need to "cycle" some computations back and forth from C++ and Python. That is, I will need to move back and forth from C++ and Python a matrix of doubles.
In C++ the matrix of data is a "gsl_matrix" object while in python the same matrix is implemented as a "numpy array".
At the moment, I am running my C++ code, saving the matrix to file, reading it from python, writing it back to file and then opening it back again in C++ for further computations.
Since this is VERY inefficient, I would like to ask if somebody can give me an example on how to do it in a "clean" way.
I have been reading (and trying for 10 days) SWIG, Cython, Boost.Python and Boost.Numpy but I'm still not able to crack it.
Does anyone have a worked example to share?
Thanks!
Rene