|
@ -799,6 +799,14 @@ namespace storm { |
|
|
|
|
|
|
|
|
template<DdType LibraryType, typename ValueType> |
|
|
template<DdType LibraryType, typename ValueType> |
|
|
std::pair<storm::storage::SparseMatrix<ValueType>, std::vector<ValueType>> Add<LibraryType, ValueType>::toMatrixVector(storm::dd::Add<LibraryType, ValueType> const& vector, std::set<storm::expressions::Variable> const& rowMetaVariables, std::set<storm::expressions::Variable> const& columnMetaVariables, std::set<storm::expressions::Variable> const& groupMetaVariables, storm::dd::Odd const& rowOdd, storm::dd::Odd const& columnOdd) const { |
|
|
std::pair<storm::storage::SparseMatrix<ValueType>, std::vector<ValueType>> Add<LibraryType, ValueType>::toMatrixVector(storm::dd::Add<LibraryType, ValueType> const& vector, std::set<storm::expressions::Variable> const& rowMetaVariables, std::set<storm::expressions::Variable> const& columnMetaVariables, std::set<storm::expressions::Variable> const& groupMetaVariables, storm::dd::Odd const& rowOdd, storm::dd::Odd const& columnOdd) const { |
|
|
|
|
|
|
|
|
|
|
|
// Count how many choices each row group has.
|
|
|
|
|
|
std::vector<uint_fast64_t> rowGroupIndices = (this->notZero().existsAbstract(columnMetaVariables) || vector.notZero()).template toAdd<uint_fast64_t>().sumAbstract(groupMetaVariables).toVector(rowOdd); |
|
|
|
|
|
return toMatrixVector(std::move(rowGroupIndices), vector, rowMetaVariables, columnMetaVariables, groupMetaVariables, rowOdd, columnOdd); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
template<DdType LibraryType, typename ValueType> |
|
|
|
|
|
std::pair<storm::storage::SparseMatrix<ValueType>, std::vector<ValueType>> Add<LibraryType, ValueType>::toMatrixVector(std::vector<uint_fast64_t>&& rowGroupIndices, storm::dd::Add<LibraryType, ValueType> const& vector, std::set<storm::expressions::Variable> const& rowMetaVariables, std::set<storm::expressions::Variable> const& columnMetaVariables, std::set<storm::expressions::Variable> const& groupMetaVariables, storm::dd::Odd const& rowOdd, storm::dd::Odd const& columnOdd) const { |
|
|
std::vector<uint_fast64_t> ddRowVariableIndices; |
|
|
std::vector<uint_fast64_t> ddRowVariableIndices; |
|
|
std::vector<uint_fast64_t> ddColumnVariableIndices; |
|
|
std::vector<uint_fast64_t> ddColumnVariableIndices; |
|
|
std::vector<uint_fast64_t> ddGroupVariableIndices; |
|
|
std::vector<uint_fast64_t> ddGroupVariableIndices; |
|
@ -830,9 +838,6 @@ namespace storm { |
|
|
|
|
|
|
|
|
Bdd<LibraryType> columnVariableCube = Bdd<LibraryType>::getCube(this->getDdManager(), columnMetaVariables); |
|
|
Bdd<LibraryType> columnVariableCube = Bdd<LibraryType>::getCube(this->getDdManager(), columnMetaVariables); |
|
|
|
|
|
|
|
|
// Count how many choices each row group has.
|
|
|
|
|
|
std::vector<uint_fast64_t> rowGroupIndices = (this->notZero().existsAbstract(columnMetaVariables) || vector.notZero()).template toAdd<uint_fast64_t>().sumAbstract(groupMetaVariables).toVector(rowOdd); |
|
|
|
|
|
|
|
|
|
|
|
// Transform the row group sizes to the actual row group indices.
|
|
|
// Transform the row group sizes to the actual row group indices.
|
|
|
rowGroupIndices.resize(rowGroupIndices.size() + 1); |
|
|
rowGroupIndices.resize(rowGroupIndices.size() + 1); |
|
|
uint_fast64_t tmp = 0; |
|
|
uint_fast64_t tmp = 0; |
|
@ -910,6 +915,7 @@ namespace storm { |
|
|
rowIndications[0] = 0; |
|
|
rowIndications[0] = 0; |
|
|
|
|
|
|
|
|
return std::make_pair(storm::storage::SparseMatrix<ValueType>(columnOdd.getTotalOffset(), std::move(rowIndications), std::move(columnsAndValues), std::move(rowGroupIndices)), std::move(explicitVector)); |
|
|
return std::make_pair(storm::storage::SparseMatrix<ValueType>(columnOdd.getTotalOffset(), std::move(rowIndications), std::move(columnsAndValues), std::move(rowGroupIndices)), std::move(explicitVector)); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
template<DdType LibraryType, typename ValueType> |
|
|
template<DdType LibraryType, typename ValueType> |
|
|