[Osi] row names ignored in OsiSolverInterface::writeLp

Stefan Vigerske stefan at math.hu-berlin.de
Sat Oct 8 09:39:15 EDT 2011


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://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)
>
>
>
>
> _______________________________________________
> Osi mailing list
> Osi at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/osi




More information about the Osi mailing list