[Numpy-discussion] python numpy code many times slower than c++

Neal Becker ndbecker2@gmail....
Wed Jan 21 09:38:44 CST 2009


Ravi wrote:

> Hi Neal,
> 
> On Wednesday 21 January 2009 07:27:04 Neal Becker wrote:
>> It might if I had used this for all of my c++ code, but I have a big
>> library of c++ wrapped code that doesn't use pyublas.  Pyublas takes
>> numpy objects from python and allows the use of c++ ublas on it (without
>> conversion).
>>
>> Most of my code doesn't use numpy, it uses plain ublas to represent
>> vectors, and ublas handles storage.  I can only interface to/from numpy
>> with conversion.
> 
> I pointed out my code to you on c++-sig[1] a while back that solves
> precisely this problem. You found a bug with memory management that I
> fixed in the updated code. Does that still not work for you?
> 
> Regards,
> Ravi
> 
> [1]
> [http://mail.python.org/pipermail/cplusplus-sig/2008-October/013825.html

Do you know if this code will work with strided vectors?  If I pass a slice:

u = array (...)
F (u[::2])

What happens?




More information about the Numpy-discussion mailing list