[Numpy-discussion] Array of matrices - Inverse and dot
Mon Jan 26 08:59:35 CST 2009
I would like to operate in an easy and efficient way (without python loop) with arrays of matrices.
Suppose a and b are some arrays of N1*N2 matrices of size 3*3, I would like to calculate inv_a and dot_ab, which would be arrays of N1*N2 (3*3)-matrices, such as :
inv_a[i, j] = np.linalg.inv(a[i, j])
dot_ab[i, j] = np.dot(a[i, j], b[i, j])
(where a and b could be :
N1 = 5
N2 = 6
a = np.random((N1, N2, 3, 3)
b = np.random((N1, N2, 3, 3)
(Sorry to ask the list : I think it is quite a basic stuff, but searching for "array of matrices" on google didn't help me so much.)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion