[Clp] about double type variable value in solution

Emerson emersonxsu at gmail.com
Sat Jun 20 15:50:55 EDT 2015


Hi,
I'm testing a network flow problem but encounter a float-point headache.
The output is something like the following:
"~/MultiCommodityFlowTest.cpp:444: Failure
Value of: linkMap.at(make_pair(0, 3))
  Actual: 9.9986685597741598e-13
Expected: 0
"
Previously, I used glpk and nothing is wrong when using google unit
test(EXPECT_EQ). But Clp still has a couple of floating-point numbers
failures s even I use EXPECT_DOUBLE_EQ or EXPECT_FLOAT_EQ.
I think the reason is that glpk uses some default post-processing method to
handle the value of variable in solution, but Clp doesn't have this
process.
Is there a way that Clp can round the solution to a reasonable value rather
than the above value?

Thanks,
Emer

p.s. Thanks John for the last reply, I have changed the way to build a
constraint matrix from glpk to Clp, and it works better than the former.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/clp/attachments/20150620/2627dbfb/attachment.html>


More information about the Clp mailing list