[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] multiplication of linear forms not allowed
From: |
Andrew Walbran |
Subject: |
Re: [Help-glpk] multiplication of linear forms not allowed |
Date: |
Wed, 30 Nov 2005 17:45:29 +1300 |
User-agent: |
KMail/1.8.2 |
On Wed, 30 Nov 2005 7:41 am, Jorge Tavares wrote:
> Dear GLPK users,
[snip]
> In the first model, my constraint was:
>
> s.t. constraint{i in I}: sum{j in J} (r[i,j] * x[j]) <= c[i];
>
> and now it must be:
>
> s.t. constraint: sum{j in J} (sum{i in I} (a[i] * r[i,j]) * x[j]) <=
> sum{i in I} (a[i] * c[i]);
>
> But when I run glpsol, it doesn't accept the following formulation
> because of the multiplication of x[j]. It gives the error:
> "multiplication of linear forms not allowed".
Could you please clarify which of a, r, x, c are variables, and which are
parameters?
If a is a parameter, the following might work:
constraint: sum{j in J} (sum{i in I} (a[i] * r[i,j] * x[j])) <= sum{i in I}
(a[i] * c[i]);
If both a and r are variables, then this is not a linear program, and GLPK
cannot solve it (at least not without first rewriting it to be linear, if
possible).
Andrew Walbran