[Numpy-discussion] Matrix dot product over an axis(for a 3d array/list of matrices)
Thu Jul 15 11:45:21 CDT 2010
Could you place all Rot's into the same array and all the Trans's into the
same array? If you have the first index of each array refer to which array
it is numpy.dot should work fine, since numpy.dot just does the dot product
over the second to last and last indexes.
On Thu, Jul 15, 2010 at 9:38 AM, Emmanuel Bengio <email@example.com> wrote:
> I have a list of 4x4 transformation matrices, that I want to "dot with"
> another list of the same size (elementwise).
> Making a for loop that calculates the dot product of each is extremely
> I thought that maybe it's due to the fact that I have thousands of matrices
> and it's a python for loop and there's a high Python overhead.
> I do something like this:
> >> for a,b in izip(Rot,Trans):
> >> c.append(numpy.dot(a,b))
> Is there a way to do this in one instruction?
> Or is there a way to do this all using weave.inline?
> NumPy-Discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion