Browse Source

fix in get parameters from model

Former-commit-id: c4c11b2b29
tempestpy_adaptions
sjunges 9 years ago
parent
commit
93be84a4a8
  1. 2
      src/models/sparse/Model.cpp
  2. 13
      src/storage/SparseMatrix.cpp
  3. 14
      src/storage/SparseMatrix.h

2
src/models/sparse/Model.cpp

@ -320,7 +320,7 @@ namespace storm {
return this->rewardModels;
}
std::set<storm::Variable> getProbabilityParameters(Model<storm::RationalNumber> const& model) {
std::set<storm::Variable> getProbabilityParameters(Model<storm::RationalFunction> const& model) {
return storm::storage::getVariables(model.getTransitionMatrix());
}

13
src/storage/SparseMatrix.cpp

@ -1208,6 +1208,19 @@ namespace storm {
return result;
}
#ifdef STORM_HAVE_CARL
std::set<storm::Variable> getVariables(SparseMatrix<storm::RationalFunction> const& matrix)
{
std::set<storm::Variable> result;
for(auto const& entry : matrix) {
entry.getValue().gatherVariables(result);
}
return result;
}
#endif
// Explicitly instantiate the entry, builder and the matrix.
// double
template class MatrixEntry<typename SparseMatrix<double>::index_type, double>;

14
src/storage/SparseMatrix.h

@ -8,7 +8,7 @@
#include <iterator>
#include "src/utility/OsDetection.h"
#include "src/adapters/CarlAdapter.h"
#include <boost/functional/hash.hpp>
// Forward declaration for adapter classes.
@ -970,14 +970,10 @@ namespace storm {
};
std::set<storm::Variable> getVariables(SparseMatrix<storm::RationalFunction> const& matrix) {
std::set<storm::Variable> result;
for(auto const& entry : matrix) {
entry.probability.gatherVariables(result);
}
return result;
}
#ifdef STORM_HAVE_CARL
std::set<storm::Variable> getVariables(SparseMatrix<storm::RationalFunction> const& matrix);
#endif
} // namespace storage
} // namespace storm

Loading…
Cancel
Save