help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] MathProg


From: Robert Fourer
Subject: Re: [Help-glpk] MathProg
Date: Fri, 24 Sep 2004 13:14:08 -0500
User-agent: Microsoft-Entourage/10.0.0.1309

In reply to the message from >>> Andrew Makhorin <address@hidden> received
9/24/04 5:14 AM:

>> Is it possible to have a constraint generated
>> conditional on the value of a parameter? I am
>> aware of the conditional expression, but this
> <doesn't seem to do quite what I want, which is
>> to have a whole statement processed
>> conditionally. I want to do something like:
>> 
>> param p; 
>> set S := 0..9; 
>> var x{s in S}; 
>> param y{s in S};
>> var z; 
>> if p = 1 
>>       my_constraint{s in S}: x[s] + z <= y[s];
> 
> my_constraint{s in S: p = 1}: ... ;
> 
  or:

  my_constraint {s in (if p = 1 then S else {}) }: ... ;

>> Secondly, is it possible to include another file
>> in a model? I ask this because I need to create
>> several similar models with only a few different
>> constraints, and it would be easier to maintain
>> if all the common code was in one file included
>> by the others. Something similar to #include in
>> C/C++ would be ideal, but I can find no mention
>> of anything like this in the documentation.
> 
> Use GNU C preprocessor.
> 
> 
> 
> 
> _______________________________________________
> Help-glpk mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-glpk





reply via email to

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