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

2012-08-22 Thread alfa
1:58, John Reid wrote: > > > On 22/08/12 11:45, alfa wrote: >> Hi John, >> >> I'm sorry, I'm a bit confused because previously you said that the >> relevant implementation resides in >> "c++/myrrh/myrrh/python/multi_array_to_numpy.h"but now, yo

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

2012-08-22 Thread alfa
n advance. On 22/08/12 11:45, alfa wrote: > Hi John, > > I'm sorry, I'm a bit confused because previously you said that the > relevant implementation resides in > "c++/myrrh/myrrh/python/multi_array_to_numpy.h"but now, you point to > "src/python/man_mod

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

2012-08-22 Thread alfa
nt: Wednesday, August 22, 2012 12:28 PM Subject: Re: [C++-sig] Accessing 2D array from python in C++ On 22/08/12 11:13, alfa wrote: > Hi John, > > Thanks a lot for your implementation. In multi_array_to_numpy.h,  can > you give more hints on which method/function that I ca

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

2012-08-22 Thread alfa
ccess multi_arrays from python in there. http://pypi.python.org/pypi/STEME/ In particular the file c++/myrrh/myrrh/python/multi_array_to_numpy.h contains the bulk of the implementation. HTH, John. On 16/08/12 09:29, alfa wrote: > Hi, > > Could you give more hints on this or any code

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

2012-08-16 Thread alfa
_type Vp_cpp(boost::extents[X_cpp][X_cpp]); I'm still puzzled how to "manually wrap the features" in the last "..." in:     boost::python::class_< boost::multi_array<...> >(...) Thanks in advance. ____ From: Jim Bosch To: alfa

[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

[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] 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

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

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