[Numpy-discussion] Iterative Matrix Multiplication

Charles R Harris charlesr.harris at gmail.com
Sun Feb 28 21:31:05 EST 2010


On Sun, Feb 28, 2010 at 5:53 PM, Ian Mallett <geometrian at gmail.com> wrote:

> Hi,
>
> I have a list of vec3 lists (e.g. [[1,2,3],[4,5,6],[7,8,9],...]). To every
> single one of the vec3 sublists, I am currently applying transformations.  I
> need to optimize this with numpy.
>
> To get proper results, as far as I can tell, the vec3 lists must be
> expressed as vec4s: [[1,2,3],[4,5,6],[7,8,9],...] ->
> [[1,2,3,1],[4,5,6,1],[7,8,9,1],...].   Each of these needs to be
> multiplied by either a translation matrix, or a rotation and translation
> matrix.
>
> I don't really know how to approach the problem . . .
>
>
As I understand it, you want *different* matrices applied to each vector?
There are generalized ufuncs, which I haven't tried, but for small vectors
there is a trick. Let's see... heck, gmane looks to be dead at the moment.
Anyway, I posted the method on the list here a couple of years ago and I'll
put up a link if I can find it when gmane comes back.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20100228/4de491a3/attachment.html>


More information about the NumPy-Discussion mailing list