It didn&#39;t work either. I had already tried that one, but setObjName only sets an OsiSolverInterface attribute which is not used by writeLp :-( Maybe writeLp should use that attribute instead of getRowName(getNumRows(()) ?<div>

<br></div><div>Thanks!</div><div><br></div><div>Dani.<br><div><br><div class="gmail_quote">On Sat, Oct 8, 2011 at 3:39 PM, Stefan Vigerske <span dir="ltr">&lt;<a href="mailto:stefan@math.hu-berlin.de">stefan@math.hu-berlin.de</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
does it work if you set the objective name via<br>
 problem.setObjName ( &quot;obj_func&quot; );<br>
?<br>
<br>
The warning from CoinLpIO isn&#39;t that precise on it, I agree.<br>
<br>
Stefan<br>
<br>
Am 08.10.2011 10:38, schrieb Dani Pérez:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Hi,<br>
<br>
I think I came across an Osi bug or a non-documented behavior of<br>
OsiSolverInterface::writeLp.<br>
<br>
The problem arises when I set all rows and columns&#39; names and I<br>
use setIntParam (OsiNameDiscipline,2). I get the following error in writeLp<br>
(with Osi compiled with --enable-debug):<br>
<br>
Coin3007W ### CoinLpIO::is_invalid_name(): Name is empty<br>
Coin3007W ### CoinLpIO::are_invalid_names(): Invalid name: vnames[1]: (null)<br>
Coin3007W ### CoinLpIO::<u></u>setLpDataRowAndColNames(): Invalid row names<br>
Use getPreviousNames() to get the old row names.<br>
Now using default row names.<br>
<br>
<br>
I&#39;ve been debugging it a bit and it seems that writeLp expects the objective<br>
function name to be stored in the names vector at position getNumRows() (as<br></div>
stated in documentation&lt;<a href="https://projects.coin-or.org/Osi/browser/trunk/Osi/src/Osi/OsiSolverInterface.hpp?rev=1811#L892" target="_blank">https://<u></u>projects.coin-or.org/Osi/<u></u>browser/trunk/Osi/src/Osi/<u></u>OsiSolverInterface.hpp?rev=<u></u>1811#L892</a>&gt;<div class="im">

<br>
indeed).<br>
Nevertheless, adding setRowName ( getNumRows(), &quot;obj_func_name&quot; ) won&#39;t fix<br>
it.<br>
<br>
The problem seems to be that setRowName will<br></div>
check&lt;<a href="https://projects.coin-or.org/Osi/browser/trunk/Osi/src/OsiGlpk/OsiGlpkSolverInterface.cpp?rev=1811#L3417" target="_blank">https://projects.coin-<u></u>or.org/Osi/browser/trunk/Osi/<u></u>src/OsiGlpk/<u></u>OsiGlpkSolverInterface.cpp?<u></u>rev=1811#L3417</a>&gt;if<div class="im">

<br>
the index is greater or equal to getNumRows() and then silently<br>
return,<br>
in contradiction with the documentation. Is my understanding wrong? Is there<br>
another way to set the objective function name and get rid of the message?<br>
Did I hit a bug?<br>
<br>
Thanks,<br>
<br>
Dani.<br>
<br>
PS: I attach the code reproducing the problem with the compilation line on<br>
top of the file. I&#39;m using Osi-0.105, a source release dating back to 21<br>
September 2011. The trunk code seems to behave similarly but I didn&#39;t check<br>
it. I&#39;m using OsiGlpkSolverInterface (I didn&#39;t try other solvers)<br>
<br>
<br>
<br>
<br></div>
______________________________<u></u>_________________<br>
Osi mailing list<br>
<a href="mailto:Osi@list.coin-or.org" target="_blank">Osi@list.coin-or.org</a><br>
<a href="http://list.coin-or.org/mailman/listinfo/osi" target="_blank">http://list.coin-or.org/<u></u>mailman/listinfo/osi</a><br>
</blockquote>
<br>
</blockquote></div><br></div></div>