I have a 3xN
array, conceptually an array of N
3-vectors, I want to construct the
array which results from matrix multiplying a given 3x3
matrix with each column of the
array. Is there a good way to do this in a vectorized manner?
Currently, my problem is 3xN
, but I may need to consider 3xNxM
(or more) in the future.
Loopy approach
U=numpy.rand( [3,24] )
R=numpy.eye(3) # placeholder
for i in xrange( U.shape[1]):
U[:,i]=numpy.dot( R, U[:,i] )