On Wed, Jul 9, 2008 at 2:34 PM, Marlin Rowley <[EMAIL PROTECTED]>
wrote:

> Thanks Chuck, but I wasn't quit clear with my question.
>
> You answered exactly according to what I asked, but I failed to mention
> needing the dot product instead of just the product.
>
> So,
>
> v dot A = v'
>
> v'[0] = v[0]*A[0] + v[1]*A[1] + v[2]*A[2]
> v'[1] = v[0]*A[3] + v[1]*A[4] + v[2]*A[5]
> v'[2] = v[0]*A[6] + v[1]*A[7] + v[2]*A[8]
>
>

There is no built in method for this specific problem (stacks of vectors and
matrices), but you can make things work:

sum(A.reshape((-1,3))*v, axis=1)

You can do lots of interesting things using such manipulations and newaxis.
For instance, multiplying stacks of matrices by stacks of matrices etc. I
put up a post of such things once if you are interested.

Chuck
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to