From 73310b9881b754d7861b48c0ff06e40380823c17 Mon Sep 17 00:00:00 2001 From: sjunges Date: Mon, 31 Aug 2015 17:54:44 +0200 Subject: [PATCH] fixed tests: glpk had wrong minimize, solver.cpp tested in wrong direction on policy iteration in case we use top. value iteration Former-commit-id: 71215b8e463094a9ad017d223872917c25cc0a83 --- src/utility/solver.cpp | 4 +++- test/functional/solver/GlpkLpSolverTest.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utility/solver.cpp b/src/utility/solver.cpp index 0bad79f66..6f5a2bff7 100644 --- a/src/utility/solver.cpp +++ b/src/utility/solver.cpp @@ -87,6 +87,7 @@ namespace storm { { prefTech = storm::solver::MinMaxTechniqueSelection::FROMSETTINGS; setSolverType(solver); + std::cout << toString(prefTech) << std::endl; } template @@ -107,6 +108,7 @@ namespace storm { template std::unique_ptr> MinMaxLinearEquationSolverFactory::create(storm::storage::SparseMatrix const& matrix, bool trackPolicy) const { + std::cout << toString(prefTech) << std::endl; std::unique_ptr> p1; switch (solverType) { @@ -122,7 +124,7 @@ namespace storm { } case storm::solver::EquationSolverType::Topological: { - STORM_LOG_THROW(prefTech == storm::solver::MinMaxTechniqueSelection::PolicyIteration, storm::exceptions::NotImplementedException, "Policy iteration for topological solver is not supported."); + STORM_LOG_THROW(prefTech != storm::solver::MinMaxTechniqueSelection::PolicyIteration, storm::exceptions::NotImplementedException, "Policy iteration for topological solver is not supported."); p1.reset(new storm::solver::TopologicalMinMaxLinearEquationSolver(matrix)); break; } diff --git a/test/functional/solver/GlpkLpSolverTest.cpp b/test/functional/solver/GlpkLpSolverTest.cpp index 21e97bf79..7e8fcf075 100644 --- a/test/functional/solver/GlpkLpSolverTest.cpp +++ b/test/functional/solver/GlpkLpSolverTest.cpp @@ -14,7 +14,7 @@ #include "src/solver/OptimizationDirection.h" TEST(GlpkLpSolver, LPOptimizeMax) { - storm::solver::GlpkLpSolver solver(storm::OptimizationDirection::Minimize); + storm::solver::GlpkLpSolver solver(storm::OptimizationDirection::Maximize); storm::expressions::Variable x; storm::expressions::Variable y; storm::expressions::Variable z;