42 boost::adjacency_list <>
56 boost::adjacency_list <> TC;
58 (*count) = boost::num_vertices(TC);
59 (*return_tuples) =
pgr_alloc((*count), (*return_tuples));
61 boost::graph_traits < boost::adjacency_list <> >::vertex_iterator i, end;
62 boost::graph_traits < boost::adjacency_list <> >::adjacency_iterator ai, a_end;
64 for (boost::tie(i, end) = boost::vertices(TC); i != end; ++i) {
66 int64_t* target_array =
nullptr;
67 auto uid = graph.graph[u].id;
68 boost::tie(ai, a_end) = adjacent_vertices(u, TC);
69 size_t adj_siz =
static_cast<size_t>(a_end - ai);
70 target_array =
pgr_alloc(adj_siz , target_array);
72 for (; ai != a_end; ++ai) {
74 int64_t vid = graph.graph[v].id;
75 target_array[number++] = vid;
78 (*return_tuples)[sequence] = {
102 std::ostringstream log;
103 std::ostringstream notice;
104 std::ostringstream err;
116 std::vector<pgr_edge_t> edges(data_edges, data_edges + total_edges);
128 *log_msg = log.str().empty()?
131 *notice_msg = notice.str().empty()?
135 (*return_tuples) =
pgr_free(*return_tuples);
137 err << except.
what();
138 *err_msg =
pgr_msg(err.str().c_str());
139 *log_msg =
pgr_msg(log.str().c_str());
140 }
catch (std::exception &except) {
141 (*return_tuples) =
pgr_free(*return_tuples);
143 err << except.what();
144 *err_msg =
pgr_msg(err.str().c_str());
145 *log_msg =
pgr_msg(log.str().c_str());
147 (*return_tuples) =
pgr_free(*return_tuples);
149 err <<
"Caught unknown exception!";
150 *err_msg =
pgr_msg(err.str().c_str());
151 *log_msg =
pgr_msg(log.str().c_str());