I have come to a case where using a matrix would be easier than an
array. The code uses lots of dot products, so I tested scipy.dot()
performance with the code below and found that the array version is much
faster (about 3 times for the given shape). What is the reason for this?
Or is something wrong with my measurement?

regards,
r.

---
import timeit
setup = """
import numpy as nm
import scipy as sc
X = nm.random.rand( 100, 3 )
X = nm.asmatrix( X ) # (un)comment this line.
print X.shape
"""
tt = timeit.Timer( 'sc.dot( X.T, X )', setup )
print tt.timeit()
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to