Browse Source

Fixed merge error

Former-commit-id: 18d5d06921
tempestpy_adaptions
David_Korzeniewski 10 years ago
parent
commit
447285d6dd
  1. 17
      src/storage/SparseMatrix.h

17
src/storage/SparseMatrix.h

@ -773,6 +773,23 @@ namespace storm {
*/
iterator end();
/*!
* Returns a copy of the matrix with the chosen internal data type
*/
template<typename NewValueType>
SparseMatrix<NewValueType> toValueType() const {
std::vector<MatrixEntry<NewValueType>> new_columnsAndValues;
std::vector<uint_fast64_t> new_rowIndications(rowIndications);
std::vector<uint_fast64_t> new_rowGroupIndices(rowGroupIndices);
new_columnsAndValues.resize(columnsAndValues.size());
for (size_t i = 0, size = columnsAndValues.size(); i < size; ++i) {
new_columnsAndValues.at(i) = MatrixEntry<NewValueType>(columnsAndValues.at(i).getColumn(), static_cast<NewValueType>(columnsAndValues.at(i).getValue()));
}
return SparseMatrix<NewValueType>(columnCount, std::move(new_rowIndications), std::move(new_columnsAndValues), std::move(new_rowGroupIndices));
}
private:
/*!
* Creates a submatrix of the current matrix by keeping only row groups and columns in the given row group

Loading…
Cancel
Save