How to multiply matrices in GAMS
From
andres.arias23@gmail.com@21:1/5 to
All on Tue May 31 15:43:44 2016
LetÂ´s say that we want to multiply four square matrices, described as:
A(i,j)
B(j,n)
C(n,m)
D(m,w)
i and j are declared normally at the beginning of the program, but the other indices have to use alias:
alias (n,i)
alias (m,j)
alias (w,n)
So, the sentence has to be written as follows:
multiplication(i,w).. sum((m,n,j),A(i,j)*B(j,n)*C(n,m)*D(m,w));
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)