[Clp] Clp_addRows causes incorrect solution for zero coefficient

coinor at henning-thielemann.de coinor at henning-thielemann.de
Sat Nov 4 07:05:29 EDT 2023


I have written a Haskell binding to COIN-OR/Clp and added a test-suite 
with automated QuickCheck tests. It spot the following problem:
   https://hydra.nixos.org/build/239790474/nixlog/2

I think this is a bug in Clp_addRows. I have simplified the problem and 
extracted a minimal example using the C interface, see attached code.

It is a super simple problem consisting of one variable and one equation.

With the 'if' clause you can switch between Clp_addRows and 
Clp_loadProblem.

Clp_addRows yields

$ a.out
Clp0024I Matrix will be packed to eliminate 1 small elements
Clp0000I Optimal - objective value 0

which is wrong.


Clp_loadProblem yields

$ a.out
Clp3002W Empty problem - 1 rows, 1 columns and 0 elements
Clp0000I Optimal - objective value 84

which is right.


Clp_addRows works correctly, when the coefficient is not zero or when I 
specify no term for the row, at all.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: example-simplex-addrows-bug.c
Type: text/x-csrc
Size: 1047 bytes
Desc: 
URL: <http://list.coin-or.org/pipermail/clp/attachments/20231104/be76c481/attachment.bin>


More information about the Clp mailing list