Re: [C++-sig] Accessing 2D array from python in C++

2012-08-15 Thread alfa
Hi Jim, Do you mean, "you could wrap multi_array itself using class_", I should do as below: boost::python::class_ > >("PyVec").def(boost::python::vector_indexing_suite > >()); I also did as below to expose the data from python to C++: main_namespace["Vp"] = boost::python::ptr(&Vp_cpp); Ho

Re: [C++-sig] Accessing 2D array from python in C++

2012-08-15 Thread alfa
I apologize for double posting this because it was spammed before. Hi Jim, Do you mean, "you could wrap multi_array itself using class_", I should do as below: boost::python::class_ > >("PyVec").def(boost::python::vector_indexing_suite > > >()); I also did as below to expose the data from py

[C++-sig] Fw: Accessing 2D array from python in C++

2012-08-15 Thread alfa
- Forwarded Message - From: alfa To: Jim Bosch ; Development of Python/C++ integration Sent: Wednesday, August 15, 2012 10:57 AM Subject: Re: [C++-sig] Accessing 2D array from python in C++ I apologize for double posting this because it was spammed before. Hi Jim, Do you mean, "

[C++-sig] Problem exposing 2D python array in C++

2012-08-15 Thread alfa
Hi, Is the following way valid to expose a 2D array variable from python (Vp)  to c++(Vp_cpp)?    std::vector > Vp_cpp; boost::python::class_ > >("PyVec").def(boost::python::vector_indexing_suite > >()); main_namespace["Vp"] = boost::python::ptr(&Vp_cpp); But, then if I tried to manipulat

[C++-sig] Exposing 2D python array in C++

2012-08-15 Thread alfa
Hi, Is the following way valid to expose a 2D array variable from python (Vp)  to c++(Vp_cpp)?    std::vector > Vp_cpp; boost::python::class_ > >("PyVec").def(boost::python::vector_indexing_suite > > >()); main_namespace["Vp"] = boost::python::ptr(&Vp_cpp); But, then if I tried to manipula

Re: [C++-sig] Accessing 2D array from python in C++

2012-08-15 Thread Jim Bosch
On Aug 15, 2012 1:57 AM, "alfa" wrote: > > I apologize for double posting this because it was spammed before. > > Hi Jim, > > Do you mean, "you could wrap multi_array itself using class_", I should do as below: > > boost::python::class_ > >("PyVec").def(boost::python::vector_indexing_suite > >());