[Osi] Bug with the problem name in the OsiGlPk

Stefan Vigerske stefan at math.hu-berlin.de
Tue Nov 20 05:38:08 EST 2012


Hi,

I've committed your patch to trunk, will be in the next release, too.

Stefan

On 10/31/2012 04:32 PM, Bertrand Le Cun wrote:
> Hi,
>
> I have tried to register and login to the Osi trac system but it makes
> an error.
> I would like to write a ticket.
> Anyway I have detect a bug in the OsiGlpk. This bug is due to a strange
> Glpk behaviour.
>
> I have a code where I read an LP file where the problem name is empty.
> And when you try to set the problem name with setStrParam with an empty
> name (i.e. ""), glpk delete the memory for its internal string and does
> not create a new one. Then many operations after like copy of the
> OsiGlpkSolverInterface object fail.
>
> I correct the bug by using the following code for the setStrParam method
> I am agree the problem comes from Glpk and not really from Osi.
> But this a way to have a correct code...
>
> Best regards,
> Bertrand Le Cun.
>
> -----
> bool OGSI::setStrParam (OsiStrParam key,
>                        const std::string &value)
> { bool retval = false ;
>
>    switch (key)
>    { case OsiProbName:
>      { probName_ = value ;
>        if ( probName_.length()==0 ) probName_="Pb";
>        lpx_set_prob_name(lp_,const_cast<char *>(probName_.c_str())) ;
>        retval = true ;
>        break ; }
>      case OsiSolverName:
>      { retval = true ;
>        break ; }
>      case OsiLastStrParam:
>      { break ; } }
>
>    return (retval) ; }
> _______________________________________________
> Osi mailing list
> Osi at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/osi
>



More information about the Osi mailing list