[Numpy-discussion] numpy.ndarrays as C++ arrays (wrapped with boost)

Neal Becker ndbecker2 at gmail.com
Thu Sep 13 05:26:33 EDT 2007


Travis E. Oliphant wrote:

> 
>> nd to copy hundres of MB around unnecessarily.
>>
>> I think it is a real shame that boost currently doesn't properly support
>> numpy out of the box, although numpy has long obsoleted both numarray and
>> Numeric (which is both buggy and completely unsupported). All the more so
>> since writing multimedial or scientific extensions (in which numpy's
>> array interface is very natural to figure prominently) would seem such an
>> ideal use for boost.python, as soon as complex classes or compound
>> structures that need to efficiently support several (primitive) datatypes
>> are involved, boost.python could really play its strenghts compared to
>> Fortran/C based extensions.
>>
>>   
> I think it could be that boost.python is waiting for the extended buffer
> interface which is coming in Python 3.0 and Python 2.6.  This would
> really be ideal for wrapping external code in a form that plays well
> with other libraries.
> 
> 
> -Travis O.

I should also mention a couple of other efforts.  IIRC, blitz++ is very
close to what I wanted.  It has views of arrays with ref counting.  I did
make some simple demo interface of blitz++ to python.  I don't recall why I
abandoned this approach, but I think it's because blitz++ has reached it's
end-of-life.

There are several promising efforts on the horizon.  There is mtl4, which
despite much promise has so far not delivered.  There is glas.  Also, there
is D, which has strong native array support and PyD.  This latter approach
seems very interesting, but is also very immature.




More information about the NumPy-Discussion mailing list