Go to the source code of this file.
◆ do_pgr_connectedComponents()
void do_pgr_connectedComponents |
( |
pgr_edge_t * |
data_edges, |
|
|
size_t |
total_edges, |
|
|
pgr_components_rt ** |
return_tuples, |
|
|
size_t * |
return_count, |
|
|
char ** |
log_msg, |
|
|
char ** |
notice_msg, |
|
|
char ** |
err_msg |
|
) |
| |
Definition at line 47 of file connectedComponents_driver.cpp.
55 std::ostringstream log;
56 std::ostringstream err;
57 std::ostringstream notice;
68 log <<
"Working with Undirected Graph\n";
70 undigraph.insert_edges(data_edges, total_edges);
73 auto count = results.size();
76 (*return_tuples) = NULL;
79 "No paths found between start_vid and end_vid vertices";
83 (*return_tuples) =
pgr_alloc(count, (*return_tuples));
84 for (
size_t i = 0; i < count; i++) {
85 *((*return_tuples) + i) = results[i];
87 (*return_count) = count;
90 *log_msg = log.str().empty()?
93 *notice_msg = notice.str().empty()?
97 (*return_tuples) =
pgr_free(*return_tuples);
100 *err_msg =
pgr_msg(err.str().c_str());
101 *log_msg =
pgr_msg(log.str().c_str());
102 }
catch (std::exception &except) {
103 (*return_tuples) =
pgr_free(*return_tuples);
105 err << except.what();
106 *err_msg =
pgr_msg(err.str().c_str());
107 *log_msg =
pgr_msg(log.str().c_str());
109 (*return_tuples) =
pgr_free(*return_tuples);
111 err <<
"Caught unknown exception!";
112 *err_msg =
pgr_msg(err.str().c_str());
113 *log_msg =
pgr_msg(log.str().c_str());
References pgrouting::graph::Pgr_base_graph< G, T_V, T_E >::insert_edges(), pgassert, pgr_alloc(), pgrouting::algorithms::pgr_connectedComponents(), pgr_free(), pgr_msg(), UNDIRECTED, and AssertFailedException::what().
Referenced by process().