[Coin-discuss] Quick checking, if the problem is primal feasible
Daniel Stoinski
Daniel.Stoinski at nagler-company.com
Fri Jul 14 01:57:51 EDT 2006
John,
I'm really gracefull for your quick answer and the accurate axplanation.
> I can not see any way of getting rid of the initialSolve. You could
> improve the time somewhat by -
> a) using the presolved problem rather than the initial (and giving hint to
> initialSolve not to presolve).
I tried your hint using intialSolve with the presolved model and trying to
pass a hint not to presolve.
I changed the code now to
static short isPrimalInfeasible(OsiClpSolverInterface& aSolver)
{
OsiSolverInterface *solver2;
OsiPresolve pinfo;
short retval;
solver2 = pinfo.presolvedModel(aSolver, 0.0);
if (solver2 != NULL)
{
solver2->setHintParam(OsiDoPresolveInInitial, false, OsiHintTry);
solver2->initialSolve();
retval = solver2->isProvenPrimalInfeasible();
delete solver2;
}
else
retval = 1;
return retval;
}
Now
retval = solver2->isProvenPrimalInfeasible();
says always, that the problem is primal feasible, even for guaranteed no
primal infeasbile problems.
Calling aSolver.initialSolve() and returning
aSolver.isProvenPrimalInfeasible() worked correctly.
> b) making sure you have a zero objective function (probably - but if dual
> quicker then very small and random)
> c) doing tests to see if primal or dual solves faster (see point b))
Calling aSolver.getModelPtr()->primal() instead of aSolver.initialSolve()
and aSolver.isProvenPrimalInfeasible() was even (not significanlty)
slower. The same for dual().
Daniel
More information about the Coin-discuss
mailing list