[Coin-discuss] how to get variable names in CPLEX LP format using OSI?

Pu Huang puhuang at us.ibm.com
Thu Apr 20 15:12:32 EDT 2006


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/coin-discuss/attachments/20060420/021af3fb/attachment.html>


More information about the Coin-discuss mailing list