31 #ifndef INCLUDE_DOMINATOR_PGR_LENGAUERTARJANDOMINATORTREE_DRIVER_HPP_
32 #define INCLUDE_DOMINATOR_PGR_LENGAUERTARJANDOMINATORTREE_DRIVER_HPP_
36 #include <boost/graph/adjacency_list.hpp>
37 #include <boost/graph/dominator_tree.hpp>
38 #include <boost/property_map/property_map.hpp>
39 #include <boost/property_map/vector_property_map.hpp>
40 #include <boost/type_traits.hpp>
56 typedef typename G::E_i
E_i;
57 typedef typename G::V_i
V_i;
62 std::vector<pgr_ltdtree_rt> results;
63 std::vector<int64_t> idoms = std::vector<int64_t>(boost::num_vertices(graph.graph), -1);
65 make_iterator_property_map
66 (idoms.begin(), boost::get(boost::vertex_index, graph.graph));
68 CHECK_FOR_INTERRUPTS();
71 boost::lengauer_tarjan_dominator_tree(graph.graph, graph.get_V(root), dominatorTree);
72 }
catch (boost::exception
const& ex) {
75 }
catch (std::exception &e) {
83 for (boost::tie(v, vend) = vertices(graph.graph); v != vend; ++v) {
84 int64_t vid = graph[*v].id;
85 results.push_back({vid, (idoms[*v] != -1 ? (idoms[*v]+1) : 0) });
93 #endif // INCLUDE_DOMINATOR_PGR_LENGAUERTARJANDOMINATORTREE_DRIVER_HPP_