help-glpk
[Top][All Lists]
Advanced

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

RE: Re[2]: [Help-glpk] MathProg


From: Robert Fourer
Subject: RE: Re[2]: [Help-glpk] MathProg
Date: Sun, 26 Sep 2004 07:27:45 -0500

> From: address@hidden [mailto:help-glpk-
> address@hidden On Behalf Of Andrew Makhorin
> Sent: Sunday, September 26, 2004 4:25 AM
> To: address@hidden
> Cc: address@hidden
> Subject: Re[2]: [Help-glpk] MathProg
> 
> >Thanks. If I want to do this for a constraint
> >which isn't indexed over a set, is there any
> >better way than doing:
> >
> >my_constraint{i in {0}: p = 1}: x = y;
> >
> >(The problem with this is that it changes the
> >name of the constraint, which I would like to
> >avoid if possible.)
> 
> You can change row and column names using api routines lpx_set_row_name
> and lpx_set_col_name. There is no way to do that in MathProg.

Another possibility is to write

   my_constraint {if p = 1}: x = y;

In AMPL this generates one constraint named "my_constraint" if p equals 1, or no
constraint otherwise.  I haven't checked it in MathProg but it should work the
same.

Bob Fourer
address@hidden







reply via email to

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