<div dir="ltr">Hi everyone,<div><br></div><div>I have intermittently run into the following problems with LPs that I am solving. I can reproduce the first three errors and attach LPs and sample code below this message that works to reproduce the issues on my machine (error 2 only happens with "badLP1"). The fourth error is consistently produced with my full code, but the sample code does not generate it.</div><div><br></div><div>(1) Occasionally the objective value ends up being nan with an accompanying assertion failure "OsiClpSolverInterface.cpp:1203: virtual void OsiClpSolverInterface::resolve(): Assertion `modelPtr_->objectiveValue()<1.0e100' failed." (This may be related to the issue I wrote about, and was resolved, in May: <a href="https://list.coin-or.org/pipermail/clp/2017-May/001705.html">https://list.coin-or.org/pipermail/clp/2017-May/001705.html</a>.)</div><div><br></div><div>(2) When I try to avoid the problem by using an initialSolve after checking whether resolve yields a nan objective, Clp may run into a segmentation fault in gutsOfDelete at ClpSimplex.cpp:2755 when deleting rowCopy_. Before the seg-fault, I see the status message Clp0006I 13  Obj -nan Primal inf inf (103).</div><div><br></div><div>(3) If presolve is turned on for resolve, an error I get is ClpSimplexDual.cpp:7959: void ClpSimplexDual::resetFakeBounds(int): Assertion `!nErrors' failed, again with a preceding status of Clp0006I 3  Obj -nan Primal inf inf (6).</div><div><br></div><div>(4) Sometimes I run into an assertion failure in createRim, at ClpSimplex.cpp:4186, when calling checkClear for rowArray_[0]. This is always after the problem gets perturbed by ClpSimplexDual::perturb. This may or may not be related to a previous email from 2005: <a href="https://list.coin-or.org/pipermail/clp/2005-August/000327.html" target="_blank">https://list.coin-or.org/pipermail/clp/2005-August/000327.html</a>, which was seemingly resolved by adding a "clear" in the relevant block of the code. However, what I see (when clear is run) is that one element of the CoinIndexedVector, rowArray_[0], is non-zero (at an extremely large number), while nElements_ is 0, so the block of code starting at CoinIndexedVector.cpp:47 is not entered into.</div><div><br></div><div>I am using <span style="font-size:13px">Clp version 1.16 </span>build Jun 17 2017 <span style="font-size:13px">on a Fedora machine. The compilation options are: enable_debug=yes, enable_gnu_packages=yes, with blas and lapack.</span></div><div><span style="font-size:13px"><br></span></div><div>The LP is resolved many times with different objective functions. There are many free variables in the LP, which I think may be relevant. The LP is also probably numerically unstable (e.g., in badLP1, the smallest coefficient is 1e-6 and the largest is 80640, and badLP2 is worse). I set a time limit of five seconds for each solve (which may or may not be relevant).</div><div><br></div><div>Please let me know if I can provide any more information,</div><div>Alex</div><div><br></div><div>=== Errors ===</div><div>// Set generateError1 to false if you want to see error 2</div><div>const bool generateError1 = true; // must be false to get error 2</div><div>const bool generateError2 = true;<br></div><div>const bool generateError3 = false;  // must be false to get error 1 or error 2</div><div><div>const int num_iters = 1000;<br></div><div>int iter = 0;</div><div><br></div></div><div>if (generateError3) {</div><div>  solver->setHintParam(OsiDoPresolveInResolve, 1);<br></div><div>}</div><div><div>solver->getModelPtr()->setMaximumSeconds(5);<br></div><div>solver->initialSolve();</div><div>while (iter < num_iters) {</div><div>    for (int i = 0; i < solver->getNumCols(); i++) {</div><div>      solver->getModelPtr()->setMaximumSeconds(5);</div><div>      solver->setObjCoeff(i, 1.);</div><div>      solver->resolve();</div><div>      if (!generateError1 && std::isnan(solver->getObjValue())) {</div><div>        solver->getModelPtr()->setMaximumSeconds(5);</div><div>        solver->initialSolve();</div><div>        if (generateError2 && solver->isProvenOptimal()) {</div><div>          solver->resolve();</div><div>        }</div><div>      } else if (generateError1) {</div><div>        solver->resolve();</div><div>      }</div><div>      solver->setObjCoeff(i, 0.);</div><div>    }</div><div>    iter++;</div><div>}</div></div></div>