[Coin-lpsolver] possible bug in OsiClp

John J Forrest jjforre at us.ibm.com
Thu Jul 26 11:28:07 EDT 2007


Anureet,

The documentation also says you can have NULL for rhs and range.  Doin this
triggers an assert in OsiClp or OsiCpx.  OsiDylp seems to have correct
code.

I have put my version of corrected OsiClpSolverInterface.cpp in trunk.

John


                                                                           
             Anureet Saxena                                                
             <anureet at yahoo.co                                             
             m>                                                         To 
             Sent by:                  coin-lpsolver at list.coin-or.org,     
             coin-lpsolver-bou         anureet at yahoo.com                   
             nces at list.coin-or                                          cc 
             .org                                                          
                                                                   Subject 
                                       [Coin-lpsolver] possible bug in     
             07/25/2007 10:47          OsiClp                              
             PM                                                            
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




hi,

I am using the latest version of Cgl, and the accompanying OsiClp code. I
beleive there is a problem on 1665 of the file OsiClpSolverInterface.cpp. I
hereby reproduce the relevent code.

void
OsiClpSolverInterface::loadProblem(const CoinPackedMatrix& matrix,
                       const double* collb, const double* colub,
                       const double* obj,
                       const char* rowsen, const double* rowrhs,
                       const double* rowrng)
{
  // Get rid of integer information (modelPtr will get rid of its copy)
  assert( rowsen != NULL );
  assert( rowrhs != NULL );
  int numrows = matrix.getNumRows();
  double * rowlb = new double[numrows];
  double * rowub = new double[numrows];
  for (int i = numrows-1; i >= 0; --i) {
    convertSenseToBound(rowsen[i],rowrhs[i],rowrng[i],rowlb[i],rowub
[i]); /** PROBLEM */
  }
  loadProblem(matrix, collb, colub, obj, rowlb, rowub);
  delete [] rowlb;
  delete [] rowub;
}
Note that the above code will give a segmentation fault if rowrng=NULL.
However the documentation in OsiClpSolverInterface.hpp says that
rowrng=NULL is allowed, and in that case rowrng[i]=0 is assumed for all
ranged rows. Thus we either need to change the documentation or modify the
above function to account for the possibility rowrng=NULL.

regards,
anureet,



Anureet Saxena
anureet at cmu.edu
anureet at yahoo.com

--This mail was delivered to you on 100% recyclable electrons.


 Pinpoint customers who are looking for what you sell.
_______________________________________________
Coin-lpsolver mailing list
Coin-lpsolver at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/coin-lpsolver







More information about the Clp mailing list