From f54c2fb8e7dc20df6024c853e11cd1ea3ee4a5c7 Mon Sep 17 00:00:00 2001
From: dehnert <dehnert@cs.rwth-aachen.de>
Date: Tue, 8 Mar 2016 10:00:17 +0100
Subject: [PATCH] tests passing again

Former-commit-id: 8e3311f4c7afd7dfc456e22ad7998b929aee76ed
---
 src/modelchecker/csl/helper/SparseCtmcCslHelper.cpp | 2 +-
 src/storage/SparseMatrix.cpp                        | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/modelchecker/csl/helper/SparseCtmcCslHelper.cpp b/src/modelchecker/csl/helper/SparseCtmcCslHelper.cpp
index 5043c8296..a4724da46 100644
--- a/src/modelchecker/csl/helper/SparseCtmcCslHelper.cpp
+++ b/src/modelchecker/csl/helper/SparseCtmcCslHelper.cpp
@@ -354,7 +354,7 @@ namespace storm {
                 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException, "The uniformization rate must be positive.");
                 
                 storm::storage::SparseMatrix<ValueType> uniformizedMatrix = computeUniformizedMatrix(rateMatrix, storm::storage::BitVector(numberOfStates, true), uniformizationRate, exitRateVector);
-                
+
                 // Compute the total state reward vector.
                 std::vector<ValueType> totalRewardVector = rewardModel.getTotalRewardVector(rateMatrix, exitRateVector);
                 
diff --git a/src/storage/SparseMatrix.cpp b/src/storage/SparseMatrix.cpp
index 99e21ee0d..9795dbe2d 100644
--- a/src/storage/SparseMatrix.cpp
+++ b/src/storage/SparseMatrix.cpp
@@ -498,7 +498,7 @@ namespace storm {
             if (!this->rowGroupIndices) {
                 STORM_LOG_ASSERT(trivialRowGrouping, "Only trivial row-groupings can be constructed on-the-fly.");
                 this->rowGroupIndices = std::vector<index_type>(this->getRowCount() + 1);
-                for (uint_fast64_t group = 0; group < this->getRowCount(); ++group) {
+                for (uint_fast64_t group = 0; group <= this->getRowCount(); ++group) {
                     this->rowGroupIndices.get()[group] = group;
                 }
             }
@@ -1224,7 +1224,10 @@ namespace storm {
             // Iterate over all row groups.
             for (typename SparseMatrix<ValueType>::index_type group = 0; group < matrix.getRowGroupCount(); ++group) {
                 out << "\t---- group " << group << "/" << (matrix.getRowGroupCount() - 1) << " ---- " << std::endl;
-                for (typename SparseMatrix<ValueType>::index_type i = matrix.hasTrivialRowGrouping() ? group : matrix.getRowGroupIndices()[group]; i < matrix.hasTrivialRowGrouping() ? group + 1 : matrix.getRowGroupIndices()[group + 1]; ++i) {
+                typename SparseMatrix<ValueType>::index_type start = matrix.hasTrivialRowGrouping() ? group : matrix.getRowGroupIndices()[group];
+                typename SparseMatrix<ValueType>::index_type end = matrix.hasTrivialRowGrouping() ? group + 1 : matrix.getRowGroupIndices()[group + 1];
+                
+                for (typename SparseMatrix<ValueType>::index_type i = start; i < end; ++i) {
                     typename SparseMatrix<ValueType>::index_type nextIndex = matrix.rowIndications[i];
                     
                     // Print the actual row.