diff --git a/src/storm/storage/SparseMatrix.cpp b/src/storm/storage/SparseMatrix.cpp index 1a005d2d0..905fbffa9 100644 --- a/src/storm/storage/SparseMatrix.cpp +++ b/src/storm/storage/SparseMatrix.cpp @@ -1571,7 +1571,7 @@ namespace storm { typename SparseMatrix::index_type SparseMatrix::getNonconstantRowGroupCount() const { index_type nonConstRowGroups = 0; for (index_type rowGroup=0; rowGroup < this->getRowGroupCount(); ++rowGroup) { - for( auto const& entry : this->getRowGroup(rowGroup)){ + for (auto const& entry : this->getRowGroup(rowGroup)){ if(!storm::utility::isConstant(entry.getValue())){ ++nonConstRowGroups; break; @@ -1584,11 +1584,18 @@ namespace storm { template bool SparseMatrix::isProbabilistic() const { storm::utility::ConstantsComparator comparator; - for(index_type row = 0; row < this->rowCount; ++row) { + for (index_type row = 0; row < this->rowCount; ++row) { if(!comparator.isOne(getRowSum(row))) { return false; } } + for (auto const& entry : *this) { + if (comparator.isConstant(entry.getValue())) { + if (comparator.isLess(entry.getValue(), storm::utility::zero())) { + return false; + } + } + } return true; }