[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Fixed values in Variable statement
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] Fixed values in Variable statement |
Date: |
Wed, 2 Jul 2008 22:48:11 +0400 |
> I'm trying to specify fixed values to some variables in an array using =
> expression (see "4.3 Variable statement" in GMPL Reference). Something
> like this:
> set MySet;
> set MySubset within MySet;
> var X {i in MySet} = if i in MySubset then 0 else binary;
> or, similarly:
> var X {i in MySet diff MySubset}, binary;
> var X {i in MySubset} = 0;
> How can i do this in GMPL?
*All* elemental variables in the array of variables can be fixed as
follows:
var x{...} = <numeric expression> ;
However, to fix *some* elemental variables you should use correspodning
equality constraints, for example:
s.t. fpp{i in MySubset}: x[i] = 0;
This is normal, because such constraints will be removed by the mip
preprocessor.