1 /* Copyright (c) 2015-2023. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #include "src/mc/api/ClockVector.hpp"
8 namespace simgrid::mc {
10 ClockVector ClockVector::max(const ClockVector& cv1, const ClockVector& cv2)
12 auto max_vector = ClockVector();
14 for (const auto& [aid, value] : cv1.contents)
15 max_vector[aid] = std::max(value, cv2.get(aid).value_or(0));
17 for (const auto& [aid, value] : cv2.contents)
18 max_vector[aid] = std::max(value, cv1.get(aid).value_or(0));
23 } // namespace simgrid::mc