diff --git a/src/storm/utility/vector.h b/src/storm/utility/vector.h index 2721ee381..0deed45ba 100644 --- a/src/storm/utility/vector.h +++ b/src/storm/utility/vector.h @@ -928,6 +928,19 @@ namespace storm { return true; } + template + T maximumElementDiff(std::vector const& vectorLeft, std::vector const& vectorRight) { + T maxDiff = storm::utility::zero(); + auto leftIt = vectorLeft.begin(); + auto leftIte = vectorLeft.end(); + auto rightIt = vectorRight.begin(); + for (; leftIt != leftIte; ++leftIt, ++rightIt) { + T diff = *leftIt - *rightIt; + T possDiff = storm::utility::abs(diff); + maxDiff = maxDiff < possDiff ? possDiff : maxDiff; + } + return maxDiff; + } template T computeSquaredNorm2Difference(std::vector const& b1, std::vector const& b2) {