const auto wrapped_state = this->state_manager_.get_state(state_id);
xbt_assert(wrapped_state != std::nullopt,
"\n\n****** INVARIANT VIOLATION ******\n"
- "To each UDPOR event corresponds a state, but state %lu does not exist. "
+ "To each UDPOR event corresponds a state, but state %llu does not exist. "
"Please report this as a bug.\n"
"*********************************\n\n",
state_id);
#include "src/mc/explo/udpor/EventSet.hpp"
-#include <algorithm>
#include <iterator>
namespace simgrid::mc::udpor {
EventSet EventSet::subtracting(const EventSet& other) const
{
- std::set<UnfoldingEvent*> result;
- std::set_difference(this->events_.begin(), this->events_.end(), other.events_.begin(), other.events_.end(),
- std::inserter(result, result.end()));
+ std::unordered_set<UnfoldingEvent*> result = this->events_;
+
+ for (UnfoldingEvent* e : other.events_)
+ result.erase(e);
+
return EventSet(std::move(result));
}
EventSet EventSet::make_union(const EventSet& other) const
{
- std::set<UnfoldingEvent*> result;
- std::set_union(this->events_.begin(), this->events_.end(), other.events_.begin(), other.events_.end(),
- std::inserter(result, result.end()));
+ std::unordered_set<UnfoldingEvent*> result = this->events_;
+
+ for (UnfoldingEvent* e : other.events_)
+ result.insert(e);
+
return EventSet(std::move(result));
}
#include "src/mc/explo/udpor/udpor_forward.hpp"
#include <cstddef>
-#include <set>
+#include <unordered_set>
namespace simgrid::mc::udpor {
class EventSet {
private:
- std::set<UnfoldingEvent*> events_;
- explicit EventSet(std::set<UnfoldingEvent*>&& raw_events) : events_(raw_events) {}
+ std::unordered_set<UnfoldingEvent*> events_;
+ explicit EventSet(std::unordered_set<UnfoldingEvent*>&& raw_events) : events_(raw_events) {}
public:
EventSet() = default;