help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] glp_mip_col_val is returning negative zero


From: Agostina Kodelia
Subject: Re: [Help-glpk] glp_mip_col_val is returning negative zero
Date: Sat, 2 May 2015 19:10:11 +0000 (UTC)

Thank you so much, Andrew! 



El Viernes, 1 de mayo, 2015 15:17:06, Andrew Makhorin <address@hidden> escribió:


On Fri, 2015-05-01 at 15:17 +0000, Agostina Kodelia wrote:
> Hi!
>  I'm solving a very simple postman travelling problem with
> the glp_intopt method. When I retrieved the column value
> with glp_mip_col_val, it returns a negative zero. The zero is alright,
> but I don't understand why has a minus, could anyone explain to me why
> is this happening?
>

This is because the IEEE 754 standard which most of modern FPUs conform
to claims that a floating-point zero has the sign bit. A negative zero
may appear, for example, on computing (2. - 3.) * (5. - 5.) = -1. * +0.
= -0.

For details see http://en.wikipedia.org/wiki/IEEE_754-1985#Zero .


>
> Thanks in advance!!
>
>
> Agostina.
>
>
> PS: This is the problem.
>
>
> Minimize
>  Z: + 10 Y01 + 20 Y12 + 30 Y20 + 60 Y21 + 70 Y02 + 80 Y10
>
>
> Subject To
>  C1: + Y20 + Y10 = 1
>  C2: + Y21 + Y01 = 1
>  C3: + Y12 + Y02 = 1
>  C4: + Y12 + Y10 = 1
>  C5: + Y02 + Y01 = 1
>  C6: + Y21 + Y20 = 1
>
>
> Bounds
>  0 <= Y01 <= 1
>  0 <= Y12 <= 1
>  0 <= Y20 <= 1
>  0 <= Y21 <= 1
>  0 <= Y02 <= 1
>  0 <= Y10 <= 1
>
>
> End
>
>






reply via email to

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