|
|
@ -4,14 +4,12 @@ |
|
|
|
#include <utility>
|
|
|
|
|
|
|
|
#include "storm/adapters/GmmxxAdapter.h"
|
|
|
|
|
|
|
|
#include "storm/environment/solver/GmmxxSolverEnvironment.h"
|
|
|
|
|
|
|
|
#include "storm/utility/vector.h"
|
|
|
|
#include "storm/exceptions/AbortException.h"
|
|
|
|
#include "storm/utility/constants.h"
|
|
|
|
|
|
|
|
#include "storm/utility/gmm.h"
|
|
|
|
#include "storm/utility/vector.h"
|
|
|
|
#include "storm/utility/SignalHandler.h"
|
|
|
|
|
|
|
|
namespace storm { |
|
|
|
namespace solver { |
|
|
@ -71,7 +69,10 @@ namespace storm { |
|
|
|
maxIter = env.solver().gmmxx().getMaximalNumberOfIterations(); |
|
|
|
} |
|
|
|
gmm::iteration iter(storm::utility::convertNumber<ValueType>(env.solver().gmmxx().getPrecision()), 0, maxIter); |
|
|
|
iter.set_callback([](const gmm::iteration& iteration) -> void { STORM_LOG_THROW(!storm::utility::resources::isTerminate(), storm::exceptions::AbortException, "Gmm++ (externally) aborted after " << iteration.get_iteration() << " iterations."); }); |
|
|
|
|
|
|
|
// We use throwing an exception to abort within Gmm++
|
|
|
|
try { |
|
|
|
// Invoke gmm with the corresponding settings
|
|
|
|
if (method == GmmxxLinearEquationSolverMethod::Bicgstab) { |
|
|
|
if (preconditioner == GmmxxLinearEquationSolverPreconditioner::Ilu) { |
|
|
@ -98,6 +99,9 @@ namespace storm { |
|
|
|
gmm::gmres(*gmmxxA, x, b, gmm::identity_matrix(), env.solver().gmmxx().getRestartThreshold(), iter); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (storm::exceptions::AbortException const& e) { |
|
|
|
// Do nothing
|
|
|
|
} |
|
|
|
|
|
|
|
if (!this->isCachingEnabled()) { |
|
|
|
clearCache(); |
|
|
|