[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-glpk] [Fwd: Issue in 4.51]
From: |
Andrew Makhorin |
Subject: |
Re: [Bug-glpk] [Fwd: Issue in 4.51] |
Date: |
Tue, 25 Jun 2013 22:30:00 +0400 |
> Attached is the compressed file.
>
Thank you.
I guess you build your model by using glpk api routines. Please check
your code, namely, all calls to glp_set_col_bnds. Looks like for some
columns you specify the type GLP_DB and set lower and/or upper bounds
to, resp., -DBL_MAX and +DBL_MAX; probably these "infinite" bounds come
from earlier calls to glp_get_col_lb/ub. Such bounds are meaningless and
should not be specified; unfortunately, glp_set_col_bnds doesn't check
this error, which leads to the bug in the lp presolver.
To avoid this error you need to check bounds before any call to
glp_set_col_bnds and specify the column type appropriately, e.g.
if (lb < -1e20 && ub > +1e20)
type = GLP_FR;
else if (ub > +1e20)
type = GLP_LO;
else if (lb < -1e20)
type = GLP_UP;
else if (fabs(lb - ub) < 1e-12)
type = GLP_DB;
else
type = GLP_FX;
glp_set_col_bnds(P, j, type, lb, ub);
If, however, you obtain column bounds with glp_get_col_lb/ub, you may
obtain corresponding column type with glp_get_col_type.
Hope this helps.
Please note that this error doesn't appear in 4.50 due to a happy chance
only.
Andrew Makhorin