Hi folks,

this is probably very easy to do, but  probably there are optimal ways to 
do it that escape me. What I would like to do is the following kind
of operation: suppose I have a set of 3-element vectors labelled r1, 
r2,...,rN, and a set of matrices M1, M2,...,MN. FOr the sake of simplicity 
assume these are 2x2 matrices of the form Mk= [[ ak, bk] [ck,dk]]. Then I 
want to evaluate 

r1*M1 + r2*M2 + ... + rN*MN

producing an array of vectors such that the result is of the form

[[ a1*r1 + a2*r2 + ... +aN*rN, b1*r1 + b2*r2 + ... + bN*rN] 
[c1*r1+c2*r2+...+cN*rN , d1*r1 + d2*r2 + ... + dN*rN ]]

Is there a simple way to do that, other than using simple loops? 

Thanks a lot,

Ferran.

Reply via email to