help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Error : multiplication of linear forms not allowed


From: hncp
Subject: Re: [Help-glpk] Error : multiplication of linear forms not allowed
Date: Mon, 5 Apr 2010 10:29:11 -0700 (PDT)

Thanks for the response.

In my previous post I have been wrong in identifying the constraint. What I
actually need is something like XOR operator, not AND operator, i.e. z[i] =
p[i] xor p[i+1]

I tried to write this as follows,
s.t. cntr1{i in PROCESSES}: z[i] = ((p[i] + (if i < 6 then p[i+1] else 1))
mod (2));

This gives me an error "operand preceding mod has invalid type", please help
me to get this corrected.

Thanks


Andrew Makhorin wrote:
> 
>> When I try to add this constraint as follows
>> s.t. cntr1{i in PROCESSES}: 0 <= p[i] + p[i+1] - 2*z[i] <= 1;
>>  I'm getting an error saying "p[6] out of domain
>> Model processing error"
> 
>> In the data section PROCESSES are defined as
>> set PROCESSES := 1 2 3 4 5;
> 
>> When specifying the constraint how can I set a p[i+1] a default value
>> if i+1 is not in the domain?
> 
> s.t. cntr1{i in PROCESSES}:
> 0 <= p[i] + (if i < n then p[i+1] else ???) - 2*z[i] <= 1;
> 
> Replace ??? by a default value.
> 
> 
> 
> _______________________________________________
> Help-glpk mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-glpk
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Error-%3A-multiplication-of-linear-forms-not-allowed-tp28111773p28142396.html
Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]