#include "SolveGoal.h" #include #include "storm/utility/solver.h" #include "storm/solver/LinearEquationSolver.h" #include "storm/solver/MinMaxLinearEquationSolver.h" namespace storm { namespace storage { template class SparseMatrix; } namespace solver { template std::unique_ptr> configureMinMaxLinearEquationSolver(BoundedGoal const& goal, storm::solver::MinMaxLinearEquationSolverFactory const& factory, storm::storage::SparseMatrix const& matrix) { std::unique_ptr> p = factory.create(matrix); p->setOptimizationDirection(goal.direction()); p->setTerminationCondition(std::make_unique>(goal.relevantValues(), goal.boundIsStrict(), goal.thresholdValue(), goal.minimize())); return p; } template std::unique_ptr> configureMinMaxLinearEquationSolver(SolveGoal const& goal, storm::solver::MinMaxLinearEquationSolverFactory const& factory, storm::storage::SparseMatrix const& matrix) { if (goal.isBounded()) { return configureMinMaxLinearEquationSolver(static_cast const&>(goal), factory, matrix); } std::unique_ptr> solver = factory.create(matrix); solver->setOptimizationDirection(goal.direction()); return solver; } template std::unique_ptr> configureLinearEquationSolver(BoundedGoal const& goal, storm::solver::LinearEquationSolverFactory const& factory, storm::storage::SparseMatrix const& matrix) { std::unique_ptr> solver = factory.create(matrix); solver->setTerminationCondition(std::make_unique>(goal.relevantValues(), goal.thresholdValue(), goal.boundIsStrict(), goal.minimize())); return solver; } template std::unique_ptr> configureLinearEquationSolver(SolveGoal const& goal, storm::solver::LinearEquationSolverFactory const& factory, storm::storage::SparseMatrix const& matrix) { if (goal.isBounded()) { return configureLinearEquationSolver(static_cast const&>(goal), factory, matrix); } return factory.create(matrix); } template std::unique_ptr> configureMinMaxLinearEquationSolver(BoundedGoal const& goal, storm::solver::MinMaxLinearEquationSolverFactory const& factory, storm::storage::SparseMatrix const& matrix); template std::unique_ptr> configureMinMaxLinearEquationSolver(SolveGoal const& goal, storm::solver::MinMaxLinearEquationSolverFactory const& factory, storm::storage::SparseMatrix const& matrix); template std::unique_ptr> configureLinearEquationSolver(BoundedGoal const& goal, storm::solver::LinearEquationSolverFactory const& factory, storm::storage::SparseMatrix const& matrix); template std::unique_ptr> configureLinearEquationSolver(SolveGoal const& goal, storm::solver::LinearEquationSolverFactory const& factory, storm::storage::SparseMatrix const& matrix); #ifdef STORM_HAVE_CARL template std::unique_ptr> configureMinMaxLinearEquationSolver(BoundedGoal const& goal, storm::solver::MinMaxLinearEquationSolverFactory const& factory, storm::storage::SparseMatrix const& matrix); template std::unique_ptr> configureMinMaxLinearEquationSolver(SolveGoal const& goal, storm::solver::MinMaxLinearEquationSolverFactory const& factory, storm::storage::SparseMatrix const& matrix); #endif } }