From a271e5ce63cea115ab74782c16df1cd843fbf52a Mon Sep 17 00:00:00 2001 From: dehnert Date: Sat, 7 Dec 2013 00:39:35 +0100 Subject: [PATCH] Working towards making every (remaining) test work Former-commit-id: e4560e07f21396955a03ad8b6476e1c4407c220e --- src/models/Dtmc.h | 4 ++-- src/models/Mdp.h | 3 ++- src/storage/SparseMatrix.cpp | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/models/Dtmc.h b/src/models/Dtmc.h index e56e6e1c1..bf3654498 100644 --- a/src/models/Dtmc.h +++ b/src/models/Dtmc.h @@ -322,12 +322,12 @@ private: for (uint_fast64_t row = 0; row < this->getTransitionMatrix().getRowCount(); ++row) { T sum = this->getTransitionMatrix().getRowSum(row); + if (sum == 0) { - LOG4CPLUS_ERROR(logger, "Row " << row << " has sum 0"); return false; } if (std::abs(sum - 1) > precision) { - LOG4CPLUS_ERROR(logger, "Row " << row << " has sum " << sum); + LOG4CPLUS_ERROR(logger, "Row " << row << " has sum " << sum << "."); return false; } } diff --git a/src/models/Mdp.h b/src/models/Mdp.h index 66165c8f2..aad76c1ef 100644 --- a/src/models/Mdp.h +++ b/src/models/Mdp.h @@ -52,7 +52,7 @@ public: boost::optional> const& optionalTransitionRewardMatrix, boost::optional>> const& optionalChoiceLabeling) : AbstractNondeterministicModel(transitionMatrix, stateLabeling, nondeterministicChoiceIndices, optionalStateRewardVector, optionalTransitionRewardMatrix, optionalChoiceLabeling) { - if (!this->checkValidityOfProbabilityMatrix()) { + if (!this->checkValidityOfProbabilityMatrix()) { LOG4CPLUS_ERROR(logger, "Probability matrix is invalid."); throw storm::exceptions::InvalidArgumentException() << "Probability matrix is invalid."; } @@ -216,6 +216,7 @@ private: double precision = s->getOptionByLongName("precision").getArgument(0).getValueAsDouble(); for (uint_fast64_t row = 0; row < this->getTransitionMatrix().getRowCount(); row++) { T sum = this->getTransitionMatrix().getRowSum(row); + if (sum == 0) continue; if (std::abs(sum - 1) > precision) { return false; diff --git a/src/storage/SparseMatrix.cpp b/src/storage/SparseMatrix.cpp index b148c4b99..c1c54a643 100644 --- a/src/storage/SparseMatrix.cpp +++ b/src/storage/SparseMatrix.cpp @@ -231,6 +231,7 @@ namespace storm { columnIndications.push_back(column); columnCount = column + 1; rowCount = row + 1; + ++currentEntryCount; } }