From 08ad2fe2f377d05a4dcd9f338e1fa329c2471bc1 Mon Sep 17 00:00:00 2001 From: dehnert Date: Sun, 9 Dec 2012 17:54:08 +0000 Subject: [PATCH] Fixed non-convergence of Eigen solver (for crowds examples) by correctly invoking solveWithGuess instead of solve. --- src/modelChecker/EigenDtmcPrctlModelChecker.h | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/modelChecker/EigenDtmcPrctlModelChecker.h b/src/modelChecker/EigenDtmcPrctlModelChecker.h index e62a765ad..deaebb9ef 100644 --- a/src/modelChecker/EigenDtmcPrctlModelChecker.h +++ b/src/modelChecker/EigenDtmcPrctlModelChecker.h @@ -218,17 +218,7 @@ public: solver.setTolerance(0.000001); - bool hasConverged = false; - int turns = 6; - while (!hasConverged) { - vectorX = solver.solve(vectorB); - hasConverged = (solver.info() != Eigen::ComputationInfo::NoConvergence) || (turns <= 0); - if (!hasConverged) { - LOG4CPLUS_INFO(logger, "EigenDtmcPrctlModelChecker did not converge with " << solver.iterations() << " of max. " << solver.maxIterations() << "Iterations, restarting "); - solver.setMaxIterations(solver.maxIterations() * 2); - } - --turns; - } + vectorX = solver.solveWithGuess(vectorB, vectorX); if(solver.info() == Eigen::ComputationInfo::InvalidInput) { // solving failed