]> AND Public Git Repository - simgrid.git/blob - src/mc/explo/udpor/Comb.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add Comb data structure for K-partial alternatives
[simgrid.git] / src / mc / explo / udpor / Comb.cpp
1 /* Copyright (c) 2008-2023. The SimGrid Team. All rights reserved.          */
2
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. */
5
6 #include "src/mc/explo/udpor/Comb.hpp"
7
8 #include <functional>
9
10 namespace simgrid::mc::udpor {
11
12 auto Comb::combinations_begin() const
13 {
14   std::vector<std::reference_wrapper<const Spike>> references;
15   std::transform(spikes.begin(), spikes.end(), std::back_inserter(references),
16                  [](const Spike& spike) { return std::cref(spike); });
17   return simgrid::xbt::variable_for_loop<const Spike>(std::move(references));
18 }
19
20 auto Comb::combinations_end() const
21 {
22   return simgrid::xbt::variable_for_loop<const Spike>();
23 }
24
25 } // namespace simgrid::mc::udpor