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) {