diff --git a/src/storm/models/sparse/MarkovAutomaton.cpp b/src/storm/models/sparse/MarkovAutomaton.cpp index 485aa8a64..568775727 100644 --- a/src/storm/models/sparse/MarkovAutomaton.cpp +++ b/src/storm/models/sparse/MarkovAutomaton.cpp @@ -93,11 +93,7 @@ namespace storm { template ValueType MarkovAutomaton::getMaximalExitRate() const { - ValueType result = storm::utility::zero(); - for (auto markovianState : this->markovianStates) { - result = std::max(result, this->exitRates[markovianState]); - } - return result; + return storm::utility::vector::max_if(this->exitRates, this->markovianStates); } template diff --git a/src/storm/utility/vector.h b/src/storm/utility/vector.h index 828ef1ed5..889561c2b 100644 --- a/src/storm/utility/vector.h +++ b/src/storm/utility/vector.h @@ -563,9 +563,7 @@ namespace storm { ++it; for (; it != ite; ++it) { - if (values[*it] > current) { - current = values[*it]; - } + current = std::max(values[*it], current); } return current; } @@ -588,9 +586,7 @@ namespace storm { ++it; for (; it != ite; ++it) { - if (values[*it] < current) { - current = values[*it]; - } + current = std::min(values[*it], current); } return current; }