Numpy slow at vector cross product?

BartC bc at freeuk.com
Tue Nov 22 07:45:12 EST 2016


On 22/11/2016 12:34, Skip Montanaro wrote:
>> I'm simply suggesting there is plenty of room for improvement. I even
> showed a version that did *exactly* what numpy does (AFAIK) that was three
> times the speed of numpy even executed by CPython. So there is some mystery
> there.
>
> As I indicated in my earlier response, your version doesn't pass all of
> numpy's cross product unit tests. Fix that and submit a patch to the numpy
> maintainers. I suspect it would be accepted.

I saw your response but didn't understand it. My code was based around 
what Peter Otten posted from numpy sources.

I will have a look. Don't forget however that all someone is trying to 
do is to multiply two vectors. They're not interested in axes 
transformation or making them broadcastable, whatever that means.

So making numpy.cross do all that may simply be too big a cost.

-- 
bartc




More information about the Python-list mailing list