I have a C++ library that defines the following (and more like them) types:
typedef std::vector< double > DoubleVec;
typedef std::vector< DoubleVec > DoubleVecVec;
typedef std::vector< int > IntVec;
typedef std::vector< IntVec > IntVecVec;
I am trying to create a python interface to a library that handles objects like that. As the title states, I would like my interface to convert to/from C++ std::vector and numpy ndarray.
I have seen both numpy.i provided by the numpy people and std_vector.i from the SWIG people. The problems are that numpy.i was created to handle C/C++ arrays (not C++ vectors) and std_vector.i doesn't do conversion directly to/from numpy arrays.
Any ideas?
I have seen that the FEniCS project has done something like this, but their project is so large that I am having a hard time finding out just how they do this specific task.