[Cbc] reading SOS item from CPLEX LP files
John Forrest
john.forrest at fastercoin.com
Sun Feb 18 14:40:33 EST 2018
Kish,
This was more difficult to fix than I expected. The coding for readLp
uses fscanf("%s") which is totally dependent on space as a separator.
I think I have fixed in trunk (you can just copy over CoinLpIO.?pp to
stable. I have tried it on all the .lp files I have - which is not that
many. Some files had lines with more than 100K characters which caused
some problems.
Please can people check I have not introduced any bugs. Also if you
want any other cosmetic changes - now is the time to ask for them.
John Forrest
On 16/02/18 11:51, Kish Shen wrote:
> Hi,
>
> I posted about this to coin-discuss mailing list yesterday, but it has
> not appear there, and there seems to be no messages for the list since
> Sept 2017, so I am posting this here as well, in case something is
> wrong with the coin-discuss mailing list.
>
> I am getting errors from Cbc when reading an LP format file generated
> by CPLEX 12:
>
> ### CoinLpIO::readLp(): bad SOS item S1
>
> I assume this is from reading the SOS items in the LP file like:
>
> s999: S1 :: x1154 : 1 x5539 : 2
>
> Looking at CoinLpIO.cpp, the code expects no space between S1 and ::
>
> if
> (next>=buff&&(!strncmp(next,"S1::",4)||!strncmp(next,"S2::",4))) {
> setType = next[1]-'0';
> gotStart=true;
> } else {
> // error
> goodLine=0;
> }
>
> I edited the LP file and changed all the 'S1 ::' to 'S1::', and I then
> got errors about x1154: repeatedly.
> So it looks like the error handling does not advance to the next line
> after finding an error.
>
> I edited removed all the spaces before ':' for the SOS items, and the
> file was then read without errors.
>
> Should ReadLp be changed to read the SOS items generated by CPLEX with
> the extra spaces?
>
> I am running the latest stable branch of Cbc 2.9, downloaded via svn
> co about 2 days ago.
>
> Thanks and cheers,
>
> Kish
>
>
>
> _______________________________________________
> Cbc mailing list
> Cbc at list.coin-or.org
> https://list.coin-or.org/mailman/listinfo/cbc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20180218/37758aa9/attachment.html>
More information about the Cbc
mailing list