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

@ -772,6 +772,23 @@ namespace storm {
* @return An iterator that points past the end of the last row of the matrix. * @return An iterator that points past the end of the last row of the matrix.
*/ */
iterator end(); 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: private:
/*! /*!

Loading…
Cancel
Save