Hi All,
I am succesfully using SWIG generated wreppers to export my C++ library to Ruby.
In my C++ library I extensively use nested C++ vectors like:
typedef std::vector<double> DblVtr; //1D-vector (vector of doubles)
typedef std::vector<DblVtr> DblVtr2; //2D-vector (vector of vectors of doubles)
When using SWIG genereted wrappers, I cannot figure out how to initialize
2D-vector from 2D Ruby arrays.
v1=3D DblVtr.new [1.0, 2.0] # works fine
v2=3D DblVtr2.new [v1, v1] # works fine
v3=3D Dbl2.new [[1.0, 2.0], [1.0, 2.0]] # does NOT work!
What is the PROPER way of building nested containers when dealing with
SWIG and Ruby??
Any help is highly appreciated.
Thanks,
--Leo--