[SciPy-user] blitz++ and numarray

Faheem Mitha faheem at email.unc.edu
Mon Mar 29 13:46:45 CST 2004


Hi,

I'm considering the use of the Blitz++ C++ library
(http://www.oonumerics.org/blitz/) along with numarray/Numeric. I want
to pass an array down to C++ and then manipulate it using Blitz++.

My current thinking is to use the Numeric interface to pass down the
array, and then copy it to a blitz++ array object. This seems
straightforward except I am a little concerned about those reference
counting issues, which I don't properly understand (I'm a Python
beginner). I do get the impression that it is mainly an issue if I am
working with Python objects in C/C++ code, though, and I am mostly
going to try to avoid doing so by declaring C++ objects within the C++
code and working with those as much as possible.

Other possibilities include somehow using the Boost.Python package,
though I am not sure how. One advantage of this is that it apparently
takes care of the reference counting issue. However, I don't want to
learn yet another API.

Also, weave.blitz() from SciPy looks relevant/useful, but this
automatically generates its own C++ code, and I'd prefer to write my
own.

Can anyone suggested a good basic tutorial which discusses the issues
of reference counting in a C/C++ API context? I have tried reading the
official documentation and will continue to do so, but something
gentler would be useful.

Comments, suggestions gratefully appreciated. Please cc me on any
reply to faheem at email.unc.edu. Thanks in advance.

                                                    Faheem.



More information about the SciPy-user mailing list