<br><font size=2 face="sans-serif">Miroslav,</font>
<br>
<br><font size=2 face="sans-serif">It should be okay now. &nbsp;It was
not designed to do slacks initially and in fact would complain if NDEBUG
had not been defined.</font>
<br>
<br><font size=2 face="sans-serif">John Forrest</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Miroslav Karamanov &lt;miroslav@andrew.cmu.edu&gt;</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">12/29/2004 03:35 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;</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td valign=top><font size=1 face="sans-serif">coin-discuss@list.coin-or.org</font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td valign=top>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td valign=top><font size=1 face="sans-serif">[Coin-discuss] OsiClpSolverInterface::getBInvACol()</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>Hello,<br>
<br>
It seems the tableau obtained by OsiClpSolverInterface::getBInvACol() <br>
differs from the one from OsiClpSolverInterface::getBInvARow() and the
<br>
difference is in the sign of the slack/artificial columns.<br>
Matthew Galati kindly helped me localize the problem and pointed out <br>
that this is not the case when the tableau is obtained through Clp, not
<br>
through Osi. The function below shows this. I attached a small test <br>
instance too but the problem appeared with all instances I tested.<br>
The incorrect routine seems to be OsiClpSolverInterface::getBInvACol().<br>
<br>
Best,<br>
Miroslav<br>
<br>
==========================<br>
Miroslav Karamanov<br>
PhD Student<br>
Carnegie Mellon University<br>
==========================<br>
<br>
<br>
========================================================<br>
void TableauCheck(OsiClpSolverInterface * siCLP){<br>
<br>
 &nbsp; &nbsp;/*<br>
 &nbsp; &nbsp; &nbsp;---<br>
 &nbsp; &nbsp; &nbsp;--- CLP tableau from getBInvARow = from getBInvACol<br>
 &nbsp; &nbsp; &nbsp;---<br>
 &nbsp; &nbsp;*/<br>
 &nbsp; &nbsp;int ii, jj, i, j;<br>
 &nbsp; &nbsp;int n_cols = siCLP-&gt;getNumCols();<br>
 &nbsp; &nbsp;int n_rows = siCLP-&gt;getNumRows();<br>
 &nbsp; &nbsp;double * binvACol &nbsp;= (double*) malloc(n_rows * sizeof(double));<br>
 &nbsp; &nbsp;double * binvASRow = (double*) malloc(n_cols * sizeof(double));<br>
 &nbsp; &nbsp;double * binvAARow = (double*) malloc(n_rows * sizeof(double));<br>
 &nbsp; &nbsp;double * binvARow &nbsp;= (double*) malloc((n_cols+n_rows)
* sizeof(double));<br>
 &nbsp; &nbsp;int &nbsp; &nbsp;* indCol &nbsp; &nbsp; = (int*) &nbsp; malloc((n_cols+n_rows)
* sizeof(int));<br>
 &nbsp; &nbsp;int &nbsp; &nbsp;* indRow &nbsp; &nbsp; = (int*) &nbsp; malloc(n_rows
* sizeof(int));<br>
<br>
 &nbsp; &nbsp;CoinPackedMatrix Mcol;<br>
 &nbsp; &nbsp;CoinPackedMatrix Mrow;<br>
 &nbsp; &nbsp;CoinPackedMatrix OSIMcol;<br>
 &nbsp; &nbsp;CoinPackedMatrix OSIMrow;<br>
<br>
 &nbsp; &nbsp;CoinIotaN(indCol, n_cols+n_rows, 0);<br>
 &nbsp; &nbsp;CoinIotaN(indRow, n_rows, &nbsp; &nbsp; &nbsp; &nbsp;0);<br>
<br>
 &nbsp; &nbsp;Mcol.setDimensions &nbsp; (n_rows, 0);<br>
 &nbsp; &nbsp;Mrow.setDimensions &nbsp; (0, &nbsp; &nbsp; &nbsp;n_cols+n_rows);<br>
 &nbsp; &nbsp;OSIMcol.setDimensions(n_rows, 0); &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;// tableau accessed<br>
through OSI<br>
 &nbsp; &nbsp;OSIMrow.setDimensions(0, &nbsp; &nbsp; &nbsp;n_cols+n_rows);<br>
<br>
 &nbsp; &nbsp;for(j = 0; j &lt; (n_cols + n_rows); j++){<br>
 &nbsp; &nbsp; &nbsp;/* access artificial columns thru CLP directly, not
thru OSI */<br>
 &nbsp; &nbsp; &nbsp;siCLP-&gt;getModelPtr()-&gt;getBInvACol(j, binvACol);<br>
 &nbsp; &nbsp; &nbsp;Mcol.appendCol(n_rows, indRow, binvACol);<br>
<br>
 &nbsp; &nbsp; &nbsp;// access through OSI<br>
 &nbsp; &nbsp; &nbsp;siCLP-&gt;getBInvACol(j, binvACol);<br>
 &nbsp; &nbsp; &nbsp;OSIMcol.appendCol(n_rows, indRow, binvACol);<br>
 &nbsp; &nbsp;}<br>
<br>
 &nbsp; &nbsp;for(i = 0; i &lt; n_rows; i++){<br>
 &nbsp; &nbsp; &nbsp;siCLP-&gt;getModelPtr()-&gt;getBInvARow(i, binvASRow,
binvAARow);<br>
 &nbsp; &nbsp; &nbsp;for(jj = 0; jj &lt; n_cols; jj++)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;binvARow[jj] = binvASRow[jj];<br>
 &nbsp; &nbsp; &nbsp;for(ii = 0; ii &lt; n_rows; ii++)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;binvARow[n_cols+ii] = binvAARow[ii];<br>
 &nbsp; &nbsp; &nbsp;Mrow.appendRow(n_cols+n_rows, indCol, binvARow);<br>
<br>
 &nbsp; &nbsp; &nbsp;// access through OSI<br>
 &nbsp; &nbsp; &nbsp;siCLP-&gt;getBInvARow(i, binvASRow, binvAARow);<br>
 &nbsp; &nbsp; &nbsp;for(jj = 0; jj &lt; n_cols; jj++)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;binvARow[jj] = binvASRow[jj];<br>
 &nbsp; &nbsp; &nbsp;for(ii = 0; ii &lt; n_rows; ii++)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;binvARow[n_cols+ii] = binvAARow[ii];<br>
 &nbsp; &nbsp; &nbsp;OSIMrow.appendRow(n_cols+n_rows, indCol, binvARow);<br>
 &nbsp; &nbsp;}<br>
<br>
 &nbsp; &nbsp;printf(&quot;\nCOL MATRIX:&quot;);<br>
 &nbsp; &nbsp;Mcol.dumpMatrix();<br>
<br>
 &nbsp; &nbsp;printf(&quot;\nROW MATRIX:&quot;);<br>
 &nbsp; &nbsp;Mrow.dumpMatrix();<br>
<br>
 &nbsp; &nbsp;assert(Mcol.isEquivalent2(Mrow));<br>
<br>
 &nbsp; &nbsp;printf(&quot;\nCOL MATRIX (OSI):&quot;);<br>
 &nbsp; &nbsp;OSIMcol.dumpMatrix();<br>
<br>
 &nbsp; &nbsp;printf(&quot;\nROW MATRIX (OSI):&quot;);<br>
 &nbsp; &nbsp;OSIMrow.dumpMatrix();<br>
<br>
 &nbsp; &nbsp;assert(OSIMcol.isEquivalent2(OSIMrow));<br>
<br>
 &nbsp; &nbsp;free(binvACol);<br>
 &nbsp; &nbsp;free(binvASRow);<br>
 &nbsp; &nbsp;free(binvAARow);<br>
 &nbsp; &nbsp;free(binvARow);<br>
 &nbsp; &nbsp;free(indCol);<br>
 &nbsp; &nbsp;free(indRow);<br>
<br>
}<br>
==========================================================<br>
NAME small<br>
ROWS<br>
 N &nbsp;obj<br>
 L &nbsp;c1<br>
 L &nbsp;c2<br>
COLUMNS<br>
 x0 &nbsp; &nbsp;obj &nbsp; &nbsp;-1 &nbsp; &nbsp; c1 &nbsp; 1<br>
 x0 &nbsp; &nbsp;c2 &nbsp; &nbsp; &nbsp;2<br>
 x1 &nbsp; &nbsp;obj &nbsp; &nbsp;-1 &nbsp; &nbsp; c1 &nbsp; 2<br>
 x1 &nbsp; &nbsp;c2 &nbsp; &nbsp; &nbsp;1<br>
RHS<br>
 rhs &nbsp; c1 &nbsp; &nbsp; &nbsp;1 &nbsp; &nbsp; c2 &nbsp; 1<br>
ENDATA<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>
</tt></font>
<br>