[Coin-lpsolver] possible bug in OsiClp
Anureet Saxena
anureet at yahoo.com
Wed Jul 25 22:47:05 EDT 2007
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/clp/attachments/20070725/a7b4167e/attachment.html>
More information about the Clp
mailing list