[SciPy-user] Fastest dtype for matrix multiplication
Sat Oct 20 23:49:29 CDT 2007
I am interested in doing matrix multiplication, but all I really care
about is if the elements are nonzero or not (after all the
multiplication is done).
Which dtype should I use to accomplish this in the fastest manner?
I did some quick tests...and it seemed like dtype=bool was quite slow
(contrary to my expectations). Could someone explain this and
recommend the best dtype? So far, it seems like float64 is the best.
These are 36x36 matrices:
In : T0.dtype
In : timeit dot(T0,T1)
10000 loops, best of 3: 87.4 µs per loop
In : T0b.dtype
In : timeit dot(T0b,T1b)
1000 loops, best of 3: 175 µs per loop
In : T0i.dtype
In : timeit dot(T0i,T1i)
10000 loops, best of 3: 189 µs per loop
More information about the SciPy-user