views:

17

answers:

0

Hi.

I would like to convert numpy array to some double* or stl vector on the c++ side. I'm actually using PyCXX for this and I can't figure out the way to access the data.

I'm currently able to access and return the data buffer like this :

Py::Object arrayShape(const Py::Tuple& args ){
     Py::Object array= args[0];
     return array.getAttr("data");
}

But I don't know what to do with it. My final goal, is to obtain a gsl_vector out of it. Ideally, I wouldn't have to recopy the memory. But maybe it is too much to ask ;)