Re: Boost python : get the shape of a numpy ndarray in C++ code.

2007-05-10 Thread TG
What I'm trying to say here : a numpy array is supposed to have it's shape stored as a tuple. What I want to do is to access this information from my C++ code, in order to do some validity check. So, by looking around in the doc of boost/python/numeric.hpp I was able to do this : void Layer::set_

Re: Boost python : get the shape of a numpy ndarray in C++ code.

2007-05-09 Thread Roman Yakovenko
On 9 May 2007 08:08:46 -0700, TG <[EMAIL PROTECTED]> wrote: > Hi there. > > I'm strugling here with some boost python code (damn I hate C++) : > > All I want to do is to initialize the content of an array with a numpy > ndarray parameter. I have this, which actually works. But I want to > add some

Boost python : get the shape of a numpy ndarray in C++ code.

2007-05-09 Thread TG
Hi there. I'm strugling here with some boost python code (damn I hate C++) : All I want to do is to initialize the content of an array with a numpy ndarray parameter. I have this, which actually works. But I want to add some kind of data check such as : * is array two dimensional ? * are the dim