diff --git a/src/storage/SparseMatrix.cpp b/src/storage/SparseMatrix.cpp index 4184109cb..4b0e1d476 100644 --- a/src/storage/SparseMatrix.cpp +++ b/src/storage/SparseMatrix.cpp @@ -524,7 +524,9 @@ namespace storm { for (std::vector::iterator it = fakeRowGroupIndices.begin(); it != fakeRowGroupIndices.end(); ++it, ++i) { *it = i; } - return getSubmatrix(rowConstraint, columnConstraint, fakeRowGroupIndices, insertDiagonalElements); + auto res = getSubmatrix(rowConstraint, columnConstraint, fakeRowGroupIndices, insertDiagonalElements); + res.rowGroupIndices = this->rowGroupIndices; + return res; } } @@ -634,7 +636,13 @@ namespace storm { template SparseMatrix SparseMatrix::restrictRows(storm::storage::BitVector const& rowsToKeep) const { // For now, we use the expensive call to submatrix. + assert(rowsToKeep.size() == getRowCount()); + assert(rowsToKeep.getNumberOfSetBits() >= getRowGroupCount()); SparseMatrix res(getSubmatrix(false, rowsToKeep, storm::storage::BitVector(getColumnCount(), true), false)); + assert(res.getRowCount() == rowsToKeep.getNumberOfSetBits()); + assert(res.getColumnCount() == getColumnCount()); + std::cout << getRowGroupCount() << std::endl; + std::cout << res.getRowGroupCount() << std::endl; assert(getRowGroupCount() == res.getRowGroupCount()); return res; }