#include "src/utility/solver.h" #include "src/settings/Settings.h" #include "src/solver/NativeLinearEquationSolver.h" #include "src/solver/GmmxxLinearEquationSolver.h" #include "src/solver/NativeNondeterministicLinearEquationSolver.h" #include "src/solver/GmmxxNondeterministicLinearEquationSolver.h" #include "src/solver/GurobiLpSolver.h" #include "src/solver/GlpkLpSolver.h" namespace storm { namespace utility { namespace solver { std::shared_ptr getLpSolver(std::string const& name) { std::string const& lpSolver = storm::settings::Settings::getInstance()->getOptionByLongName("lpsolver").getArgument(0).getValueAsString(); if (lpSolver == "gurobi") { return std::shared_ptr(new storm::solver::GurobiLpSolver(name)); } else if (lpSolver == "glpk") { return std::shared_ptr(new storm::solver::GlpkLpSolver(name)); } throw storm::exceptions::InvalidSettingsException() << "No suitable LP solver selected."; } template std::shared_ptr> getLinearEquationSolver() { std::string const& linearEquationSolver = storm::settings::Settings::getInstance()->getOptionByLongName("linsolver").getArgument(0).getValueAsString(); if (linearEquationSolver == "gmm++") { return std::shared_ptr>(new storm::solver::GmmxxLinearEquationSolver()); } else if (linearEquationSolver == "native") { return std::shared_ptr>(new storm::solver::NativeLinearEquationSolver()); } throw storm::exceptions::InvalidSettingsException() << "No suitable linear equation solver selected."; } template std::shared_ptr> getNondeterministicLinearEquationSolver() { std::string const& nondeterministicLinearEquationSolver = storm::settings::Settings::getInstance()->getOptionByLongName("ndsolver").getArgument(0).getValueAsString(); if (nondeterministicLinearEquationSolver == "gmm++") { return std::shared_ptr>(new storm::solver::GmmxxNondeterministicLinearEquationSolver()); } else if (nondeterministicLinearEquationSolver == "native") { return std::shared_ptr>(new storm::solver::NativeNondeterministicLinearEquationSolver()); } throw storm::exceptions::InvalidSettingsException() << "No suitable nondeterministic linear equation solver selected."; } template std::shared_ptr> getLinearEquationSolver(); template std::shared_ptr> getNondeterministicLinearEquationSolver(); } } }