help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Testing LPX* cols for non-integer bounds


From: Andrew Makhorin
Subject: Re: [Help-glpk] Testing LPX* cols for non-integer bounds
Date: Mon, 10 Oct 2005 23:11:23 +0400

> One of the exit codes for lpx_integer(LPX*) is
> LPX_E_FAULT.
> 
> The manual (p51) lists one cause for this as being
> "some integer variable has non-integer lower or upper
> bound".
> 
> I would like to test for this defect prior to calling
> the solver.  And wish to know what threshold is used
> to determine a "non-integer".  For instance, on my
> current platform, the following test would accept
> 2.0 + 1.0e-016 and reject 2.0 + 1.0e-015.
> 
>    double ub = lpx_get_col_ub(lpxObject, col);
>    if (ub == double(int(ub))) {}  // okay
>    else                           // complain
> 
> What tolerance does GLPK use?  I suspect it might be
> something more like 1.0e-008?

Bounds of variables marked as integer must be exact integer numbers
with no tolerance, i.e. the condition bnd == floor(bnd) must be
satisfied, where bnd is a lower/upper bound.

However, to check if a node solution is integer feasible, other
criterion is used, namely, the current value of a variable is
considered as integral, if it differs from the nearest integer at most
by 1e-6 (this is *absolute* tolerance used by default).





reply via email to

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