Browse Source

Fixed simplify.

Former-commit-id: 85504746d7
tempestpy_adaptions
dehnert 10 years ago
parent
commit
d06c5b4a0c
  1. 6
      src/modelchecker/reachability/SparseSccModelChecker.cpp
  2. 11
      src/utility/ConstantsComparator.cpp
  3. 5
      src/utility/ConstantsComparator.h

6
src/modelchecker/reachability/SparseSccModelChecker.cpp

@ -43,6 +43,9 @@ namespace storm {
}
}
// Make sure that we have eliminated all transitions from the initial state.
STORM_LOG_ASSERT(flexibleMatrix.getRow(*initialStates.begin()).empty(), "The transitions of the initial states are non-empty.");
auto modelCheckingEnd = std::chrono::high_resolution_clock::now();
auto totalTimeEnd = std::chrono::high_resolution_clock::now();
@ -127,6 +130,7 @@ namespace storm {
storm::storage::SparseMatrix<ValueType> submatrix = dtmc.getTransitionMatrix().getSubmatrix(false, maybeStates, maybeStates);
// To be able to apply heuristics later, we now determine the distance of each state to the initial state.
// We start by setting up the data structures.
std::vector<std::pair<storm::storage::sparse::state_type, std::size_t>> stateQueue;
stateQueue.reserve(submatrix.getRowCount());
storm::storage::BitVector statesInQueue(submatrix.getRowCount());
@ -138,7 +142,7 @@ namespace storm {
statesInQueue.set(initialState);
}
// Perform a BFS.
// And then perform the BFS.
while (currentPosition < stateQueue.size()) {
std::pair<storm::storage::sparse::state_type, std::size_t> const& stateDistancePair = stateQueue[currentPosition];
distances[stateDistancePair.first] = stateDistancePair.second;

11
src/utility/ConstantsComparator.cpp

@ -21,17 +21,10 @@ namespace storm {
}
template<typename ValueType>
ValueType& simplify(ValueType& value) {
ValueType simplify(ValueType value) {
// In the general case, we don't to anything here, but merely return the value. If something else is
// supposed to happen here, the templated function can be specialized for this particular type.
return value;
}
template<typename ValueType>
ValueType&& simplify(ValueType&& value) {
// In the general case, we don't to anything here, but merely return the value. If something else is
// supposed to happen here, the templated function can be specialized for this particular type.
return std::move(value);
return std::forward<ValueType>(value);
}
template<typename ValueType>

5
src/utility/ConstantsComparator.h

@ -28,10 +28,7 @@ namespace storm {
ValueType infinity();
template<typename ValueType>
ValueType& simplify(ValueType& value);
template<typename ValueType>
ValueType&& simplify(ValueType&& value);
ValueType simplify(ValueType value);
// A class that can be used for comparing constants.
template<typename ValueType>

Loading…
Cancel
Save