[Cbc] readLp fails to read LP problem without 'subjject to'

Kish Shen kish.shen at gmail.com
Mon Feb 26 11:50:27 EST 2018


Hi,

I am unable to read the following simple LP file with readLp() using Cbc:

\ENCODING=ISO-8859-1
\Problem name: eclipse

Minimize
 obj: - 2 x1 - x2 - x3
Bounds
 0 <= x1 <= 1
 0 <= x2 <= 1
 0 <= x3 <= 1
SOS
 s1: S1 ::  x1 : 1  x2 : 2  x3 : 3
End

I get the message:

[kshn at hermes Eplex]$ ./cbcreadlp
 ### ERROR: Change MAX_OBJECTIVES to larger number.

I think the message starting from '###' comes from CoinLpIO.cpp, in
read_moniom_obj:

    if (*num_objectives == MAX_OBJECTIVES){
       char str[8192];
       sprintf(str,"### ERROR: Too many objective functions.\n");
       sprintf(str,"### ERROR: Change MAX_OBJECTIVES to larger number.\n");
       throw CoinError(str, "read_monom_obj", "CoinLpIO", __FILE__,
__LINE__);
    }

abd is because there is no 'subject to' section, as the only constraints on
this problem is the SOS. When I added a 'Subject to' line following the
objective, the file was read.

I include a program to reproduce this problem, and the above lp problem
with the filename the program uses.

The LP file was generated by CPLEX, and it is able to read the file back in.

Thanks and cheers,

Kish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20180226/876de7a4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sos.cpp
Type: text/x-c++src
Size: 680 bytes
Desc: not available
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20180226/876de7a4/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testlp
Type: application/octet-stream
Size: 169 bytes
Desc: not available
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20180226/876de7a4/attachment.obj>


More information about the Cbc mailing list