[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-glpk] Rounding Problem
From: |
Volkan YAZICI |
Subject: |
[Help-glpk] Rounding Problem |
Date: |
Wed, 28 Apr 2010 17:26:16 +0300 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
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.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Help-glpk] Rounding Problem,
Volkan YAZICI <=