[Coin-discuss] how to get variable names in CPLEX LP format using OSI?
Laszlo Ladanyi
ladanyi at us.ibm.com
Fri Apr 21 13:24:51 EDT 2006
Hi Paul,
The bad news: as far as I know (but Francois may correct me) the LP format
reader loses the variable names... :-(
Sorry,
--Laci
On Thu, 20 Apr 2006, Pu Huang wrote:
> If someone uses OsiSolverInterface::readLp() to read a problem instance in
> CPLEX LP format and subsequently solve the problem. How to extract the
> variable names from the solutions?
>
> ------------------------------------
>
> si=OsiSolverInterface;
> si= new OsiClpSolverInterface;
> si->readLp("t1.lp");
>
> // solve the problem
>
> int n=si->getNumcols();
> solution =si->getColsolution();
> for(int i=0;i<n, i++){
> string name=si->?????? (what function to call?)
> cout<<name<<" = "<<solution[i]<<endl;
> }
> -------------------------------------
>
> I tried OsiSolverInterface::getColName(), but it returns names like
> "C000001", not the original variable names in the LP file.
>
> Cheers
> Paul Huang
More information about the Coin-discuss
mailing list