Alexander Kalinin
2013-05-05 11:18:50 UTC
Hello,
Look at this code:
import numpy as np
N = 500
A = np.random.rand(N, N)
B = np.random.rand(N, N)
c1 = np.dot(A, B)[:, 0]
c2 = np.dot(A, B[:, 0])
print np.linalg.norm(c1 - c2)
The output is:
3.92795839192e-13
For me it is little bit strange that the results are not the same. Does it
mean that matrix by matrix and matrix by vector multiplications algorithms
are different?
Sincerely,
Alexander
Look at this code:
import numpy as np
N = 500
A = np.random.rand(N, N)
B = np.random.rand(N, N)
c1 = np.dot(A, B)[:, 0]
c2 = np.dot(A, B[:, 0])
print np.linalg.norm(c1 - c2)
The output is:
3.92795839192e-13
For me it is little bit strange that the results are not the same. Does it
mean that matrix by matrix and matrix by vector multiplications algorithms
are different?
Sincerely,
Alexander