I have a c++ implementation wrapped with SWIG and compiled to a module which can be used by python.
I am using ctypes to call the function with ctype arguments, int double etc. The output of my_function(ctype args) is an int**, i.e. it's a multidimensional array.
How can I cast this into a 2D numpy array inside the python script? I have been looking at ctypes pointers but so far I have had no luck. I have spent many, many hours reading the C-API of python and numpy for use with SWIG, and implementing on the c++ side to return a numpy array has so far been incredibly hard and completely unsuccessful.
int**dynamically allocated? Whose job is it todelete []it? - Ericint**, i.e. it's a multidimensional array" - non sequitur. A pointer is not an array. It can point to an array, but it can also point to a single item or to nothing at all.int i; int* ip = &i; int** ipp = &ip;- Pete Becker