[Top][All Lists]

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

Re: [Help-glpk] MathProg

From: Andrew Makhorin
Subject: Re: [Help-glpk] MathProg
Date: Fri, 24 Sep 2004 14:14:06 +0400

>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}: ... ;

>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.

reply via email to

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