22 static pass_id m_unique_id_it = 0;
25 id = ++m_unique_id_it;
28 namespace pass_collection
32 std::vector<PassConfiguration> m_all_passes;
33 std::vector<PassConfiguration> m_intermediate_passes;
34 std::unordered_map<pass_id, std::unordered_set<pass_id>> m_useless_follow_ups;
35 bool m_initialized =
false;
59 using namespace std::placeholders;
85 m_useless_follow_ups[group_by_successors.
id].insert(split_by_successors.
id);
86 m_useless_follow_ups[group_by_predecessors.
id].insert(split_by_predecessors.
id);
87 m_useless_follow_ups[group_by_successors_iteratively.
id].insert(group_by_successors.
id);
88 m_useless_follow_ups[group_by_predecessors_iteratively.
id].insert(group_by_predecessors.
id);
89 m_useless_follow_ups[group_by_successor_known_groups.
id].insert(split_by_successor_known_groups.
id);
90 m_useless_follow_ups[group_by_predecessor_known_groups.
id].insert(split_by_predecessor_known_groups.
id);
101 m_all_passes.clear();
102 m_useless_follow_ups.clear();
105 std::vector<pass_id> last_pass_ids;
106 last_pass_ids.reserve(previous_passes.size());
107 std::transform(previous_passes.begin(), previous_passes.end(), std::back_inserter(last_pass_ids), [](
auto& vec) { return vec.back(); });
109 std::vector<PassConfiguration> passes;
111 for (
auto& pass : m_all_passes)
113 if (m_useless_follow_ups[pass.id].find(pass.id) == m_useless_follow_ups[pass.id].end())
115 passes.push_back(pass);
119 if (last_pass_ids.empty())
121 if (
auto it = std::find_if(passes.begin(), passes.end(), [](
auto& p) { return p.id == split_by_successors.id; }); it != passes.end())
125 if (
auto it = std::find_if(passes.begin(), passes.end(), [](
auto& p) { return p.id == split_by_predecessors.id; }); it != passes.end())
136 m_initialized =
false;
std::shared_ptr< Grouping > process(const processing::Configuration &config, const std::shared_ptr< Grouping > &state)
std::shared_ptr< Grouping > process(const processing::Configuration &config, const std::shared_ptr< Grouping > &state, bool successors)
std::shared_ptr< Grouping > process(const processing::Configuration &config, const std::shared_ptr< Grouping > &state, bool successors)
std::shared_ptr< Grouping > process(const processing::Configuration &config, const std::shared_ptr< Grouping > &state, bool successors)
std::vector< PassConfiguration > get_passes(const Configuration &config, const std::vector< std::vector< pass_id >> &previous_passes)
std::function< std::shared_ptr< Grouping >(const std::shared_ptr< Grouping > &)> pass_function
std::shared_ptr< Grouping > process(const processing::Configuration &config, const std::shared_ptr< Grouping > &state, bool successors)
std::shared_ptr< Grouping > process(const processing::Configuration &config, const std::shared_ptr< Grouping > &state, bool successors)
PassConfiguration()=default