[Osi] row names ignored in OsiSolverInterface::writeLp

Dani Pérez daniperez at users.sourceforge.net
Sat Oct 8 12:52:43 EDT 2011


On Sat, Oct 8, 2011 at 4:30 PM, Stefan Vigerske <stefan at math.hu-berlin.de>wrote:

> Hi,
>
> Nope, it works for me.
> The objective name attribute is added to the end of the rownames array that
> is assembled in OsiSolverInterface::writeLp and then passed to CoinLpIO.
> There was a bug, but that was fixed on 30th of July, see CHANGELOG. That
> fix made it into Osi releases >= 0.105.1.
>
>
ough! Really unfortunate, I didn't realize I wasn't using the last source
tarball. I was using 0.105.0. It works fine with 0.105.1, thank you very
much :-)

Dani.



> Stefan
>
>
>> Thanks!
>>
>> Dani.
>>
>> On Sat, Oct 8, 2011 at 3:39 PM, Stefan Vigerske<stefan at math.hu-**
>> berlin.de <stefan at math.hu-berlin.de>>wrote:
>>
>>  Hi,
>>>
>>> does it work if you set the objective name via
>>>  problem.setObjName ( "obj_func" );
>>> ?
>>>
>>> The warning from CoinLpIO isn't that precise on it, I agree.
>>>
>>> Stefan
>>>
>>> Am 08.10.2011 10:38, schrieb Dani Pérez:
>>>
>>>  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://**projec**ts.coin-or.org/Osi/**<http://projects.coin-or.org/Osi/**>
>>>> browser/trunk/Osi/src/Osi/****OsiSolverInterface.hpp?rev=****1811#L892<
>>>> https://projects.**coin-or.org/Osi/browser/trunk/**Osi/src/Osi/**
>>>> OsiSolverInterface.hpp?rev=**1811#L892<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/ <http://or.org/Osi/browser/trunk/Osi/**src/OsiGlpk/>
>>>> **OsiGlpkSolverInterface.cpp?****rev=1811#L3417<https://**
>>>> projects.coin-or.org/Osi/**browser/trunk/Osi/src/OsiGlpk/**
>>>> OsiGlpkSolverInterface.cpp?**rev=1811#L3417<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)
>>>>
>>>>
>>>>
>>>>
>>>> ______________________________****_________________
>>>> Osi mailing list
>>>> Osi at list.coin-or.org
>>>> http://list.coin-or.org/****mailman/listinfo/osi<http://list.coin-or.org/**mailman/listinfo/osi>
>>>> <http://**list.coin-or.org/mailman/**listinfo/osi<http://list.coin-or.org/mailman/listinfo/osi>
>>>> >
>>>>
>>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/osi/attachments/20111008/5bdb86ce/attachment.html>


More information about the Osi mailing list