|
@ -163,13 +163,26 @@ namespace storm { |
|
|
|
|
|
|
|
|
template<typename ValueType> |
|
|
template<typename ValueType> |
|
|
ValueType minimum(std::vector<ValueType> const& values) { |
|
|
ValueType minimum(std::vector<ValueType> const& values) { |
|
|
return minmax(values).first; |
|
|
|
|
|
|
|
|
assert(!values.empty()); |
|
|
|
|
|
ValueType min = values.front(); |
|
|
|
|
|
for (auto const& vt : values) { |
|
|
|
|
|
if (vt < min) { |
|
|
|
|
|
min = vt; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return min; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<typename ValueType> |
|
|
template<typename ValueType> |
|
|
ValueType maximum(std::vector<ValueType> const& values) { |
|
|
ValueType maximum(std::vector<ValueType> const& values) { |
|
|
return minmax(values).second; |
|
|
|
|
|
|
|
|
assert(!values.empty()); |
|
|
|
|
|
ValueType max = values.front(); |
|
|
|
|
|
for (auto const& vt : values) { |
|
|
|
|
|
if (vt > max) { |
|
|
|
|
|
max = vt; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return max; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
template<typename K, typename ValueType> |
|
|
template<typename K, typename ValueType> |
|
|