I'm not sure what is intended here, but the following is one example of matrix-vector multiplication:
param N integer > 0;
param A {1..N,1..N};
var r {1..N};
var v {i in 1..N} = sum {j in 1..N} A[i,j] * r[j];
The reshape will involve an assignment like
let {i in 1..N, j in 1..N} Mat[i,j] := vect[N*(i-1)+j];
but I will leave the details to the reader.
Bob Fourer
From: am...@googlegroups.com [mailto:am...@googlegroups.com]
On Behalf Of humaira fazal
Sent: Monday, May 12, 2008 4:35 PM
To: am...@googlegroups.com
Subject: [AMPL 1775] product of an
nxn matrix with nx1 vector