Hi,<div><br></div><div>I think I came across an Osi bug or a non-documented behavior of OsiSolverInterface::writeLp.</div><div><br></div><div>The problem arises when I set all rows and columns&#39; names and I use setIntParam (OsiNameDiscipline,2). I get the following error in writeLp (with Osi compiled with --enable-debug):</div>


<div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>Coin3007W ### CoinLpIO::is_invalid_name(): Name is empty</div></div><div><div>Coin3007W ### CoinLpIO::are_invalid_names(): Invalid name: vnames[1]: (null)</div>


</div><div><div>Coin3007W ### CoinLpIO::setLpDataRowAndColNames(): Invalid row names</div></div><div><div>Use getPreviousNames() to get the old row names.</div></div><div><div>Now using default row names.</div></div></blockquote>


<div><br></div><div>I&#39;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 <a href="https://projects.coin-or.org/Osi/browser/trunk/Osi/src/Osi/OsiSolverInterface.hpp?rev=1811#L892" target="_blank">documentation</a> indeed). Nevertheless, adding setRowName ( getNumRows(), &quot;obj_func_name&quot; ) won&#39;t fix it.</div>


<div><br></div><div>The problem seems to be that setRowName will <a href="https://projects.coin-or.org/Osi/browser/trunk/Osi/src/OsiGlpk/OsiGlpkSolverInterface.cpp?rev=1811#L3417" target="_blank">check</a> 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?</div>


<div><br></div><div>Thanks,</div><div><br></div><div>Dani.</div><div><br></div><div>PS: I attach the code reproducing the problem with the compilation line on top of the file. I&#39;m using Osi-0.105, a source release dating back to 21 September 2011. The trunk code seems to behave similarly but I didn&#39;t check it. I&#39;m using OsiGlpkSolverInterface (I didn&#39;t try other solvers)</div>