<div class="gmail_quote">On Sat, Oct 8, 2011 at 4:30 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,<div class="im">
<br></div>
Nope, it works for me.<br>
The objective name attribute is added to the end of the rownames array that is assembled in OsiSolverInterface::writeLp and then passed to CoinLpIO.<br>
There was a bug, but that was fixed on 30th of July, see CHANGELOG. That fix made it into Osi releases &gt;= 0.105.1.<br>
<br></blockquote><div><br></div><div>ough! Really unfortunate, I didn&#39;t realize I wasn&#39;t using the last source tarball. I was using 0.105.0. It works fine with 0.105.1, thank you very much :-)</div><div><br></div>

<div>Dani.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Stefan<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
Thanks!<br>
<br>
Dani.<br>
<br>
On Sat, Oct 8, 2011 at 3:39 PM, Stefan Vigerske&lt;<a href="mailto:stefan@math.hu-berlin.de" target="_blank">stefan@math.hu-<u></u>berlin.de</a>&gt;wrote:<br>
<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
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>
<br>
</div><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<br>
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]:<br>
(null)<br></div>
Coin3007W ### CoinLpIO::**<u></u>setLpDataRowAndColNames(): Invalid row names<div class="im"><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<br>
objective<br>
function name to be stored in the names vector at position getNumRows()<br>
(as<br></div>
stated in documentation&lt;https://**<a href="http://projects.coin-or.org/Osi/**" target="_blank">projec<u></u>ts.coin-or.org/Osi/**</a><br>
browser/trunk/Osi/src/Osi/**<u></u>OsiSolverInterface.hpp?rev=**<u></u>1811#L892&lt;<a href="https://projects.coin-or.org/Osi/browser/trunk/Osi/src/Osi/OsiSolverInterface.hpp?rev=1811#L892" target="_blank">https://projects.<u></u>coin-or.org/Osi/browser/trunk/<u></u>Osi/src/Osi/<u></u>OsiSolverInterface.hpp?rev=<u></u>1811#L892</a>&gt;<div class="im">

<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
</blockquote>
<br>
indeed).<br>
Nevertheless, adding setRowName ( getNumRows(), &quot;obj_func_name&quot; ) won&#39;t<br>
fix<br>
it.<br>
<br>
The problem seems to be that setRowName will<br></div>
check&lt;<a href="https://projects.coin-" target="_blank">https://projects.coin-</a>**<a href="http://or.org/Osi/browser/trunk/Osi/**src/OsiGlpk/" target="_blank"><u></u>or.org/Osi/browser/trunk/Osi/*<u></u>*src/OsiGlpk/</a><br>


**OsiGlpkSolverInterface.cpp?*<u></u>*rev=1811#L3417&lt;<a href="https://projects.coin-or.org/Osi/browser/trunk/Osi/src/OsiGlpk/OsiGlpkSolverInterface.cpp?rev=1811#L3417" target="_blank">https://<u></u>projects.coin-or.org/Osi/<u></u>browser/trunk/Osi/src/OsiGlpk/<u></u>OsiGlpkSolverInterface.cpp?<u></u>rev=1811#L3417</a>&gt;<div class="im">

<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
if<br>
</blockquote>
<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<br>
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<br>
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>&lt;<a href="http://list.coin-or.org/mailman/listinfo/osi" target="_blank">http://<u></u>list.coin-or.org/mailman/<u></u>listinfo/osi</a>&gt;<br>


<br>
</blockquote>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
</blockquote></div><br>