Re: [Numpy-discussion] (newbie) How can I use NumPy to wrap my C++ class with 2-dimensional arrays?

2009-08-03 Thread Raymond de Vries
Hi Chris, >> Thanks for the explanation. After having looked at the documentation, I >> decided to do my own plain Python c-api implementation. >> > > That is unlikely to be the best option these days -- it's simply too > easy to make a type checking and or reference counting error. > > If

Re: [Numpy-discussion] (newbie) How can I use NumPy to wrap my C++ class with 2-dimensional arrays?

2009-07-31 Thread Raymond de Vries
Hi Matthieu, Thanks for the explanation. After having looked at the documentation, I decided to do my own plain Python c-api implementation. Thanks for your time Raymond Matthieu Brucher wrote: > 2009/7/30 Raymond de Vries : > >> Hi >> >> >>> Indeed,

Re: [Numpy-discussion] (newbie) How can I use NumPy to wrap my C++ class with 2-dimensional arrays?

2009-07-30 Thread Raymond de Vries
gt;>> >>>> In case you know that the C++ data won't go away before the Python >>>> array, you can always wrap the container >>>> (http://matt.eifelle.com/2008/11/04/exposing-an-array-interface-with-swig-for-a-cc-structure/) >>>> with SWIG. >>>>

Re: [Numpy-discussion] (newbie) How can I use NumPy to wrap my C++ class with 2-dimensional arrays?

2009-07-30 Thread Raymond de Vries
Hi, I'm sorry, I guess I did not search properly before For the record, I solved my import_array() question: just need to add %init %{ import_array(); %} and the typemap for the std::vector works ok. Thanks for that! Now the rest... Thanks Raymond Raymond de Vries wrote: > Hi

Re: [Numpy-discussion] (newbie) How can I use NumPy to wrap my C++ class with 2-dimensional arrays?

2009-07-30 Thread Raymond de Vries
> > In case you know that the C++ data won't go away before the Python > array, you can always wrap the container > (http://matt.eifelle.com/2008/11/04/exposing-an-array-interface-with-swig-for-a-cc-structure/) > with SWIG. > > Matthieu > > 2009/7/30 Raymond de Vri

[Numpy-discussion] (newbie) How can I use NumPy to wrap my C++ class with 2-dimensional arrays?

2009-07-29 Thread Raymond de Vries
Hi everyone, (I sent this message yesterday as well but somehow it didn't come through...) I would like to ask your advice how I can use NumPy to wrap my existing C++ library with 2-dimensional arrays. I am wrapping the library with swig and I have the typemap function declaration. But now I a