Dear all,
what is the best way to multiply two matrix in GAMS?
Thanks for all your answer,
Luca
Matrix multiplication in GAMS

 User
 Posts: 83
 Joined: 2 years ago
 Location: Rosario  Argentina
Re: Matrix multiplication in GAMS
hi, the matrix dimensions must be compatible to carry out the multiplication.
Here are some examples:
or
Bye!
Here are some examples:
Code: Select all
eq(i,j).. C(i,j) =e= sum(k,A(i,k)*B(k,j));
Code: Select all
eq(i,j).. C(i,j) =e= sum((k,m)$(ord(m) eq ord(k)), A(i,k)*B(m,j) );