[Coin-lpsolver] Precision for Clp solution
Francois Margot
fmargot at andrew.cmu.edu
Mon Apr 10 10:19:50 EDT 2006
What precision can we expect for the results obtained from Clp, using
Lapack and Blas libraries on a Linux machine? Is 10e-3 too much to
expect? (I just updated my copy of COIN this morning.)
I am solving an LP (admittedly with a numerically suspect formulation,
with some coefficients smaller than 10e-10) using:
OsiClpSolverInterface *clp = new OsiClpSolverInterface;
clp->readMps("bc1.mps");
clp->initialSolve();
const double *lb = clp->getColLower();
const double *ub = clp->getColUpper();
const double *rc = clp->getReducedCost();
int ncol = clp->getNumCols();
int nrow = clp->getNumRows();
for(int i=0; i<ncol; i++) {
if((rc[i] > 1e-4) && (ub[i] - lb[i] > 1e-4) && (x[i] > lb[i] + 1e-4)) {
printf("### ERROR: var: %d rc: %f lb: %f ub: %f x: %f\n",
i, rc[i], lb[i], ub[i], x[i]);
exit(1);
}
if((rc[i] < -1e-4) && (ub[i] - lb[i] > 1e-4) && (x[i] < ub[i] - 1e-4)) {
printf("### ERROR: var: %d rc: %f lb: %f ub: %f x: %f\n",
i, rc[i], lb[i], ub[i], x[i]);
exit(1);
}
}
I get:
### ERROR: var: 8 rc: -0.002807 lb: 0.000000 ub: 10.000000 x: 0.000000
Regardless of the initial formulation, the precision of the result seems
to be at most 10e-2. The mps file bc1.mps is available from
http://plato.asu.edu/ftp/milp/
Francois
More information about the Clp
mailing list