On 10/20/05, Michael Jastrzebski <[EMAIL PROTECTED]> wrote: > > I found a strange thing. > > I had two lines of code that set both lower and upper bounds on the column: > > lpx_set_col_bnds(lp,col,LPX_LO,0.0,0.0); /* set lower to zero */ > lpx_set_col_bnds(lp,col,LPX_UP,1.0,1.0); /* set upper to 1 */ > > and this did not do the job - I got solutions that were negative. > > But when I reversed order: > > lpx_set_col_bnds(lp,col,LPX_UP,1.0,1.0); > lpx_set_col_bnds(lp,col,LPX_LO,0.0,0.0); > > Everything seems ok. > > Michael J.
I think the first example sets only an upper bound, and the second only the lower (as the second call overrides the first, it doesn't "add" the constraint). If you want a double bound, you can use LPX_DB in a single call, rather than two calls using LPX_UP and LPX_LO. Thanks, Bob _______________________________________________ Help-glpk mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-glpk
