Browse Source

Working towards making every (remaining) test work

Former-commit-id: e4560e07f2
tempestpy_adaptions
dehnert 11 years ago
parent
commit
a271e5ce63
  1. 4
      src/models/Dtmc.h
  2. 3
      src/models/Mdp.h
  3. 1
      src/storage/SparseMatrix.cpp

4
src/models/Dtmc.h

@ -322,12 +322,12 @@ private:
for (uint_fast64_t row = 0; row < this->getTransitionMatrix().getRowCount(); ++row) {
T sum = this->getTransitionMatrix().getRowSum(row);
if (sum == 0) {
LOG4CPLUS_ERROR(logger, "Row " << row << " has sum 0");
return false;
}
if (std::abs(sum - 1) > precision) {
LOG4CPLUS_ERROR(logger, "Row " << row << " has sum " << sum);
LOG4CPLUS_ERROR(logger, "Row " << row << " has sum " << sum << ".");
return false;
}
}

3
src/models/Mdp.h

@ -52,7 +52,7 @@ public:
boost::optional<storm::storage::SparseMatrix<T>> const& optionalTransitionRewardMatrix,
boost::optional<std::vector<storm::storage::VectorSet<uint_fast64_t>>> const& optionalChoiceLabeling)
: AbstractNondeterministicModel<T>(transitionMatrix, stateLabeling, nondeterministicChoiceIndices, optionalStateRewardVector, optionalTransitionRewardMatrix, optionalChoiceLabeling) {
if (!this->checkValidityOfProbabilityMatrix()) {
if (!this->checkValidityOfProbabilityMatrix()) {
LOG4CPLUS_ERROR(logger, "Probability matrix is invalid.");
throw storm::exceptions::InvalidArgumentException() << "Probability matrix is invalid.";
}
@ -216,6 +216,7 @@ private:
double precision = s->getOptionByLongName("precision").getArgument(0).getValueAsDouble();
for (uint_fast64_t row = 0; row < this->getTransitionMatrix().getRowCount(); row++) {
T sum = this->getTransitionMatrix().getRowSum(row);
if (sum == 0) continue;
if (std::abs(sum - 1) > precision) {
return false;

1
src/storage/SparseMatrix.cpp

@ -231,6 +231,7 @@ namespace storm {
columnIndications.push_back(column);
columnCount = column + 1;
rowCount = row + 1;
++currentEntryCount;
}
}

Loading…
Cancel
Save