help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] lx_set_col_bnds() - a bit strange


From: Robert Anderson
Subject: Re: [Help-glpk] lx_set_col_bnds() - a bit strange
Date: Thu, 20 Oct 2005 13:46:55 -0700

On 10/20/05, Michael Jastrzebski <address@hidden> 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




reply via email to

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