[C++-sig] blitz++ and numarray

Xavier WARIN(Compte LOCAL) - I23 xavier.warin at der.edfgdf.fr
Tue Mar 30 07:25:18 CEST 2004


Hi

Don't do it by yourself.
You'd better use SWIG  to do the wrapping, or better Boost 
(www.boost.org). You can find a wrapping for Numeric at this adresse :
http://www.eos.ubc.ca/research/clouds/num_util.html.
(It is done with Boost)
You will be able to export all C++ classes  to Python,
and use tuple, dict inside your C++ code etc...

Xavier

Faheem Mitha wrote:
> 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.
> 
> 
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
> 
> 





More information about the Cplusplus-sig mailing list