[Osi] row names ignored in OsiSolverInterface::writeLp

Dani Pérez daniperez at users.sourceforge.net
Sat Oct 8 04:38:01 EDT 2011


Hi,

I think I came across an Osi bug or a non-documented behavior of
OsiSolverInterface::writeLp.

The problem arises when I set all rows and columns' names and I
use setIntParam (OsiNameDiscipline,2). I get the following error in writeLp
(with Osi compiled with --enable-debug):

Coin3007W ### CoinLpIO::is_invalid_name(): Name is empty
Coin3007W ### CoinLpIO::are_invalid_names(): Invalid name: vnames[1]: (null)
Coin3007W ### CoinLpIO::setLpDataRowAndColNames(): Invalid row names
Use getPreviousNames() to get the old row names.
Now using default row names.


I've been debugging it a bit and it seems that writeLp expects the objective
function name to be stored in the names vector at position getNumRows() (as
stated in documentation<https://projects.coin-or.org/Osi/browser/trunk/Osi/src/Osi/OsiSolverInterface.hpp?rev=1811#L892>
indeed).
Nevertheless, adding setRowName ( getNumRows(), "obj_func_name" ) won't fix
it.

The problem seems to be that setRowName will
check<https://projects.coin-or.org/Osi/browser/trunk/Osi/src/OsiGlpk/OsiGlpkSolverInterface.cpp?rev=1811#L3417>if
the index is greater or equal to getNumRows() and then silently
return,
in contradiction with the documentation. Is my understanding wrong? Is there
another way to set the objective function name and get rid of the message?
Did I hit a bug?

Thanks,

Dani.

PS: I attach the code reproducing the problem with the compilation line on
top of the file. I'm using Osi-0.105, a source release dating back to 21
September 2011. The trunk code seems to behave similarly but I didn't check
it. I'm using OsiGlpkSolverInterface (I didn't try other solvers)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/osi/attachments/20111008/c1365fd0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RowNamesBug.cpp
Type: text/x-c++src
Size: 1350 bytes
Desc: not available
URL: <http://list.coin-or.org/pipermail/osi/attachments/20111008/c1365fd0/attachment.bin>


More information about the Osi mailing list