[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Rounding Problem
From: |
glpk xypron |
Subject: |
Re: [Help-glpk] Rounding Problem |
Date: |
Sat, 01 May 2010 08:00:53 +0200 |
Hello
GLPK uses a tolerance internally. Please change your tests, e.g.
fabs(nx) < .0001
Best regards
Xypron
-------- Original-Nachricht --------
> Datum: Wed, 28 Apr 2010 17:26:16 +0300
> Von: Volkan YAZICI <address@hidden>
> An: address@hidden
> Betreff: [Help-glpk] Rounding Problem
> Hi,
>
> I get below solutions
>
> (gdb) p glp_get_col_val(lp, 'n', 7)
> $4 = 0
> (gdb) p glp_get_col_val(lp, 'c', 0)
> $5 = 1
> (gdb) p glp_get_col_val(lp, 'c', 1)
> $6 = 1
> (gdb) p glp_get_col_val(lp, 'c', 2)
> $7 = 1
> (gdb) p glp_get_col_val(lp, 'c', 4)
> $8 = 1.0000000000000002
>
> for the following constraint.
>
> n7 - c0 - c1 - c2 - c4 >= -4
>
> n7 should be greater than 0, but because of rounding errors it passes
> the constraint check.
>
> (gdb) p (0 - 1 - 1 - 1 - 1.0000000000000002) >= -4
> 1
>
> What's the recommended way of solving such problems? I looked at ml
> archives and found out that people use glp_scale_prob() method. But for
> my particular case -- where I just check if (nx == 0.0) and if (cx ==
> 1.0) -- I couldn't figure out which option to use with glp_scale_prob()
> method. Any ideas?
>
>
> Regards.
>
>
> _______________________________________________
> Help-glpk mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-glpk
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Help-glpk] Rounding Problem,
glpk xypron <=