OsiCpx deleteCols does not update column names which can cause issues later on if one uses getColNames().<br><br>OsiClp has some code that takes care of this.<br><br>Please apply this patch (note, this also includes the patch from my fix sent last week).<br>
<br>A perhaps cleaner approach is to take the code used in OsiClp to delete a (non-sequential) array of column names and put that into an overloaded OsiSolverInterface::deleteColNames and then call that base function from OsiCpx deleteCols (and any other OsiXxx that is missing it).<br>
<br>I can't file a ticket - the server is down.<br><br><br>magh@shark:~/COIN/coin-Dip/Osi/src/OsiCpx$ svn diff<br>Index: OsiCpxSolverInterface.cpp<br>===================================================================<br>
--- OsiCpxSolverInterface.cpp (revision 1661)<br>+++ OsiCpxSolverInterface.cpp (working copy)<br>@@ -514,6 +514,9 @@<br> else<br> retval = false;<br> break;<br>+ case OsiNameDiscipline:<br>+ retval = OsiSolverInterface::setIntParam(key,value);<br>
+ break;<br> case OsiLastIntParam:<br> retval = false;<br> break;<br>@@ -605,6 +608,9 @@<br> value = hotStartMaxIteration_;<br> retval = true;<br> break;<br>+ case OsiNameDiscipline:<br>
+ retval = OsiSolverInterface::getIntParam(key,value);<br>+ break;<br> case OsiLastIntParam:<br> retval = false;<br> break;<br>@@ -2233,6 +2239,37 @@<br> }<br><br> delete[] delstat;<br>+<br>
+ //---<br>+ //--- MVG: took from OsiClp for updating names<br>+ //---<br>+ int nameDiscipline;<br>+ getIntParam(OsiNameDiscipline,nameDiscipline) ;<br>+ if (num&&nameDiscipline) {<br>+ // Very clumsy (and inefficient) - need to sort and then go backwards in ? chunks<br>
+ int * indices = CoinCopyOfArray(columnIndices,num);<br>+ std::sort(indices,indices+num);<br>+ int num2=num;<br>+ while(num2) {<br>+ int next = indices[num2-1];<br>+ int firstDelete = num2-1;<br>
+ int i;<br>+ for (i=num2-2;i>=0;i--) {<br>+ if (indices[i]+1==next) {<br>+ next --;<br>+ firstDelete=i;<br>+ } else {<br>+ break;<br>+ }<br>+ }<br>
+ OsiSolverInterface::deleteColNames(indices[firstDelete],num2-firstDelete);<br>+ num2 = firstDelete;<br>+ assert (num2>=0);<br>+ }<br>+ delete [] indices;<br>+ }<br>+<br>+<br> }<br> //-----------------------------------------------------------------------------<br>
void<br>@@ -2768,6 +2805,8 @@<br> }<br><br><br>+<br>+<br> //-----------------------------------------------------------------------------<br> // Write mps files<br> //-----------------------------------------------------------------------------<br>