[SciPy-user] Swig and Numpy arrays

Matthieu Brucher matthieu.brucher@gmail....
Thu Jan 8 04:47:52 CST 2009


In fact numpy typemaps extract the size of the array, so if I
understand correctly, this is what you don't want. So you only have to
delete this part of the typemap.
Be aware that you will not have any size checks anymore, but you still
could extract the size, compare it with your memorized size.


2009/1/8 Justin Bayer <bayer.justin@googlemail.com>:
> Hi group,
> I am currently trying to connect a C++ library of mine via SWIG to
> Python/Scipy. I have several classes that have methods which expect a
> double* as an argument of which the length is known by the object.
> So what I want to do is to connect a method with the signature
> (double* array) to a Numpy array. I had a look at numpy.i and its
> typemaps, but it seems that only typemaps are supplied which also deal
> with such bound checking behaviour in the signature. As I said, the
> bounds are held in a field of the object.
> What is the best way to get around this? I am fairly new to swig and
> wanted to know if somebody else has already encountered this problem.
> Regards,
> -Justin
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user

Information System Engineer, Ph.D.
Website: http://matthieu-brucher.developpez.com/
Blogs: http://matt.eifelle.com and http://blog.developpez.com/?blog=92
LinkedIn: http://www.linkedin.com/in/matthieubrucher

More information about the SciPy-user mailing list