From 3d7442b5c13bb105854bc09042bce3d596c41f56 Mon Sep 17 00:00:00 2001 From: TimQu Date: Thu, 3 Nov 2016 14:11:48 +0100 Subject: [PATCH] Fix in SparseMatrix::swapRows Former-commit-id: 754c5f3abff7385b058a25cff92801af6667915a --- src/storage/SparseMatrix.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/storage/SparseMatrix.cpp b/src/storage/SparseMatrix.cpp index 3d1e16796..9f715727b 100644 --- a/src/storage/SparseMatrix.cpp +++ b/src/storage/SparseMatrix.cpp @@ -684,6 +684,9 @@ namespace storm { *writeIt = std::move(intermediateRowEntry); ++writeIt; } + } else { + // skip the intermediate rows + writeIt = getRow(smallerRow).begin(); } // write the larger row for(auto& largerRowEntry : largerRowContents) { @@ -708,6 +711,9 @@ namespace storm { *writeIt = std::move(*intermediateRowEntryIt); --writeIt; } + } else { + // skip the intermediate rows + writeIt = getRow(smallerRow).end() - 1; } // write the larger row for(auto largerRowEntryIt = largerRowContents.rbegin(); largerRowEntryIt != largerRowContents.rend(); ++largerRowEntryIt) {