<br><font size=2 face="sans-serif">Hi, Laci,</font>
<br>
<br><font size=2 face="sans-serif">Thanks for your reply. I rewrote the
readLp() method, replaced its local variable &quot;COINLpIO m&quot; by
a COINLpIO pointer passed in, from this pointer, I can extract variable
names by calling COINLpIO::columnName() method. This workaround seems to
work, but I am not sure whether the variable names I got are arranged in
the same order as the solution I got from calling OsiSolverInterface::getColsolution().
&nbsp; Can Francois please answer this question?</font>
<br>
<br>
<br><font size=2 face="sans-serif">-------------------------------------------------</font>
<br>
<br><tt><font size=2>si=OsiSolverInterface;<br>
si= new OsiClpSolverInterface; </font></tt>
<br><tt><font size=2>COINLpIO * rPrt = new COINLpIO();</font></tt>
<br><tt><font size=2><br>
si-&gt;readLp(rPrt, &quot;t1.lp&quot;); &nbsp; &lt;--------the new readLp()
method<br>
<br>
// solve the problem<br>
 <br>
int n=si-&gt;getNumcols();<br>
solution =si-&gt;getColsolution();<br>
for(int i=0;i&lt;n; i++){</font></tt>
<br><font size=2 color=#820040 face="Courier New"><b>&nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;const</b></font><font size=2 face="Courier New">
</font><font size=2 color=#820040 face="Courier New"><b>char</b></font><font size=2 face="Courier New">
*name=rPrt-&gt;columnName(i);</font><tt><font size=2> &nbsp;&lt;-----------Is
it right to do so?<br>
 &nbsp; &nbsp; &nbsp; &nbsp; cout&lt;&lt;name&lt;&lt;&quot; = &quot;&lt;&lt;solution[i]&lt;&lt;endl;
&nbsp;<br>
}<br>
-------------------------------------</font></tt>
<br>
<br>
<br><tt><font size=2>Cheers</font></tt>
<br><tt><font size=2>Paul<br>
 </font></tt>
<br>
<br><font size=2 face="sans-serif"><br>
</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>ladanyi@watson.ibm.com</b>
</font>
<br><font size=1 face="sans-serif">Sent by: coin-discuss-bounces@list.coin-or.org</font>
<p><font size=1 face="sans-serif">04/21/2006 01:24 PM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
Discussions about open source software for Operations Research &nbsp; &nbsp;
&nbsp; &nbsp;&lt;coin-discuss@list.coin-or.org&gt;</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">Discussions about open source software
for Operations Research &lt;coin-discuss@list.coin-or.org&gt;</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td><font size=1 face="sans-serif">Francois Margot &lt;fmargot@andrew.cmu.edu&gt;</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: [Coin-discuss] how to get variable
names in CPLEX LP format &nbsp; &nbsp; &nbsp; &nbsp;using OSI?</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><tt><font size=2>Hi Paul,<br>
<br>
The bad news: as far as I know (but Francois may correct me) the LP format<br>
reader loses the variable names... :-(<br>
<br>
Sorry,<br>
--Laci<br>
<br>
On Thu, 20 Apr 2006, Pu Huang wrote:<br>
<br>
&gt; If someone uses OsiSolverInterface::readLp() to read a problem instance
in <br>
&gt; CPLEX LP format and subsequently solve the problem. How to extract
the <br>
&gt; variable names from the solutions?<br>
&gt; <br>
&gt; ------------------------------------<br>
&gt; <br>
&gt; si=OsiSolverInterface;<br>
&gt; si= new OsiClpSolverInterface; <br>
&gt; si-&gt;readLp(&quot;t1.lp&quot;);<br>
&gt; <br>
&gt; // solve the problem<br>
&gt; <br>
&gt; int n=si-&gt;getNumcols();<br>
&gt; solution =si-&gt;getColsolution();<br>
&gt; for(int i=0;i&lt;n, i++){<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;string name=si-&gt;??????
(what function to call?)<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; cout&lt;&lt;name&lt;&lt;&quot; = &quot;&lt;&lt;solution[i]&lt;&lt;endl;<br>
&gt; }<br>
&gt; -------------------------------------<br>
&gt; <br>
&gt; I tried OsiSolverInterface::getColName(), but it returns names like
<br>
&gt; &quot;C000001&quot;, not the original variable names in the LP file.
<br>
&gt; <br>
&gt; Cheers<br>
&gt; Paul Huang<br>
<br>
_______________________________________________<br>
Coin-discuss mailing list<br>
Coin-discuss@list.coin-or.org<br>
http://list.coin-or.org/mailman/listinfo/coin-discuss<br>
</font></tt>
<br>