|
@ -239,7 +239,7 @@ namespace storm { |
|
|
template<typename ValueType> |
|
|
template<typename ValueType> |
|
|
SparseMatrix<ValueType>::SparseMatrix(index_type columnCount, std::vector<index_type> const& rowIndications, std::vector<MatrixEntry<index_type, ValueType>> const& columnsAndValues, std::vector<index_type> const& rowGroupIndices) : rowCount(rowIndications.size() - 1), columnCount(columnCount), entryCount(columnsAndValues.size()), nonzeroEntryCount(0), columnsAndValues(columnsAndValues), rowIndications(rowIndications), rowGroupIndices(rowGroupIndices) { |
|
|
SparseMatrix<ValueType>::SparseMatrix(index_type columnCount, std::vector<index_type> const& rowIndications, std::vector<MatrixEntry<index_type, ValueType>> const& columnsAndValues, std::vector<index_type> const& rowGroupIndices) : rowCount(rowIndications.size() - 1), columnCount(columnCount), entryCount(columnsAndValues.size()), nonzeroEntryCount(0), columnsAndValues(columnsAndValues), rowIndications(rowIndications), rowGroupIndices(rowGroupIndices) { |
|
|
for (auto const& element : *this) { |
|
|
for (auto const& element : *this) { |
|
|
if (element.getValue() != storm::utility::constantZero<ValueType>()) { |
|
|
|
|
|
|
|
|
if (!storm::utility::isZero(element.getValue())) { |
|
|
++this->nonzeroEntryCount; |
|
|
++this->nonzeroEntryCount; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -248,7 +248,7 @@ namespace storm { |
|
|
template<typename ValueType> |
|
|
template<typename ValueType> |
|
|
SparseMatrix<ValueType>::SparseMatrix(index_type columnCount, std::vector<index_type>&& rowIndications, std::vector<MatrixEntry<index_type, ValueType>>&& columnsAndValues, std::vector<index_type>&& rowGroupIndices) : rowCount(rowIndications.size() - 1), columnCount(columnCount), entryCount(columnsAndValues.size()), nonzeroEntryCount(0), columnsAndValues(std::move(columnsAndValues)), rowIndications(std::move(rowIndications)), rowGroupIndices(std::move(rowGroupIndices)) { |
|
|
SparseMatrix<ValueType>::SparseMatrix(index_type columnCount, std::vector<index_type>&& rowIndications, std::vector<MatrixEntry<index_type, ValueType>>&& columnsAndValues, std::vector<index_type>&& rowGroupIndices) : rowCount(rowIndications.size() - 1), columnCount(columnCount), entryCount(columnsAndValues.size()), nonzeroEntryCount(0), columnsAndValues(std::move(columnsAndValues)), rowIndications(std::move(rowIndications)), rowGroupIndices(std::move(rowGroupIndices)) { |
|
|
for (auto const& element : *this) { |
|
|
for (auto const& element : *this) { |
|
|
if (element.getValue() != storm::utility::constantZero<ValueType>()) { |
|
|
|
|
|
|
|
|
if (!storm::utility::isZero(element.getValue())) { |
|
|
++this->nonzeroEntryCount; |
|
|
++this->nonzeroEntryCount; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -604,7 +604,7 @@ namespace storm { |
|
|
// First, we need to count how many entries each column has.
|
|
|
// First, we need to count how many entries each column has.
|
|
|
for (index_type group = 0; group < columnCount; ++group) { |
|
|
for (index_type group = 0; group < columnCount; ++group) { |
|
|
for (auto const& transition : joinGroups ? this->getRowGroup(group) : this->getRow(group)) { |
|
|
for (auto const& transition : joinGroups ? this->getRowGroup(group) : this->getRow(group)) { |
|
|
if (transition.getValue() != storm::utility::constantZero<ValueType>()) { |
|
|
|
|
|
|
|
|
if (!storm::utility::isZero(transition.getValue())) { |
|
|
++rowIndications[transition.getColumn() + 1]; |
|
|
++rowIndications[transition.getColumn() + 1]; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -623,7 +623,7 @@ namespace storm { |
|
|
// Now we are ready to actually fill in the values of the transposed matrix.
|
|
|
// Now we are ready to actually fill in the values of the transposed matrix.
|
|
|
for (index_type group = 0; group < columnCount; ++group) { |
|
|
for (index_type group = 0; group < columnCount; ++group) { |
|
|
for (auto const& transition : joinGroups ? this->getRowGroup(group) : this->getRow(group)) { |
|
|
for (auto const& transition : joinGroups ? this->getRowGroup(group) : this->getRow(group)) { |
|
|
if (transition.getValue() != storm::utility::constantZero<ValueType>()) { |
|
|
|
|
|
|
|
|
if (!storm::utility::isZero(transition.getValue())) { |
|
|
columnsAndValues[nextIndices[transition.getColumn()]] = std::make_pair(group, transition.getValue()); |
|
|
columnsAndValues[nextIndices[transition.getColumn()]] = std::make_pair(group, transition.getValue()); |
|
|
nextIndices[transition.getColumn()]++; |
|
|
nextIndices[transition.getColumn()]++; |
|
|
} |
|
|
} |
|
|