Browse Source

maixmumElementDiff implementation in vector.h

main
Jan Erik Karuc 5 years ago
parent
commit
323e82994d
  1. 13
      src/storm/utility/vector.h

13
src/storm/utility/vector.h

@ -928,6 +928,19 @@ namespace storm {
return true;
}
template<class T>
T maximumElementDiff(std::vector<T> const& vectorLeft, std::vector<T> const& vectorRight) {
T maxDiff = storm::utility::zero<T>();
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<class T>
T computeSquaredNorm2Difference(std::vector<T> const& b1, std::vector<T> const& b2) {

|||||||
100:0
Loading…
Cancel
Save