Skip to content
Snippets Groups Projects
Commit 39a566f7 authored by Oliver Sander's avatar Oliver Sander Committed by sander
Browse files

Bugfix: also fall back to IPOpt if the model decrease is nan

May happen when the matrix is singular.  UMFPack doesn't like that.

[[Imported from SVN: r9958]]
parent eaed4b65
No related branches found
No related tags found
No related merge requests found
......@@ -138,7 +138,7 @@ void TrustRegionMMGBaseSolver<MatrixType, VectorType>::solve()
matrix_->umv(*x_, tmp);
double modelDecrease = (modifiedRhs*(*x_)) - 0.5 * ((*x_)*tmp);
if (modelDecrease < 0)
if (std::isnan(modelDecrease) or modelDecrease < 0)
{
std::cout << "Model increase: " << -modelDecrease << ", falling back to slower solver" << std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment