From 19fa7767a0df47946d19395fa8a183b33ddcbb5c Mon Sep 17 00:00:00 2001 From: TimQu Date: Sun, 19 Jun 2016 15:56:21 +0200 Subject: [PATCH] scheduler retrival for value iteration of native minMaxLinEqSolver Former-commit-id: 641991da86d5cb6e91dddae90ff0de845e5a38ed --- src/solver/NativeMinMaxLinearEquationSolver.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/solver/NativeMinMaxLinearEquationSolver.cpp b/src/solver/NativeMinMaxLinearEquationSolver.cpp index 544840898..9588ad46b 100644 --- a/src/solver/NativeMinMaxLinearEquationSolver.cpp +++ b/src/solver/NativeMinMaxLinearEquationSolver.cpp @@ -76,6 +76,18 @@ namespace storm { std::swap(x, *currentX); } + // If requested, we store the scheduler for retrieval. + if (this->isTrackSchedulerSet()) { + if(iterations==0){ //may happen due to custom termination condition. Then we need to compute x'= A*x+b + this->A.multiplyWithVector(x, *multiplyResult); + storm::utility::vector::addVectors(*multiplyResult, b, *multiplyResult); + } + std::vector choices(this->A.getRowGroupCount()); + // Reduce the multiplyResult again and keep track of the choices made + storm::utility::vector::reduceVectorMinOrMax(dir, *multiplyResult, x, this->A.getRowGroupIndices(), &choices); + this->scheduler = std::make_unique(std::move(choices)); + } + if (!xMemoryProvided) { delete copyX; }