Go to the source code of this file.
◆ do_pgr_stoerWagner()
void do_pgr_stoerWagner |
( |
pgr_edge_t * |
data_edges, |
|
|
size_t |
total_edges, |
|
|
pgr_stoerWagner_t ** |
return_tuples, |
|
|
size_t * |
return_count, |
|
|
char ** |
log_msg, |
|
|
char ** |
notice_msg, |
|
|
char ** |
err_msg |
|
) |
| |
Definition at line 51 of file stoerWagner_driver.cpp.
59 std::ostringstream log;
60 std::ostringstream err;
61 std::ostringstream notice;
72 std::vector<pgr_stoerWagner_t> results;
74 log <<
"Working with Undirected Graph\n";
77 undigraph.insert_edges(data_edges, total_edges);
81 auto count = results.size();
84 (*return_tuples) = NULL;
91 (*return_tuples) =
pgr_alloc(count, (*return_tuples));
92 for (
size_t i = 0; i < count; i++) {
93 *((*return_tuples) + i) = results[i];
95 (*return_count) = count;
98 *log_msg = log.str().empty()?
101 *notice_msg = notice.str().empty()?
105 (*return_tuples) =
pgr_free(*return_tuples);
107 err << except.
what();
108 *err_msg =
pgr_msg(err.str().c_str());
109 *log_msg =
pgr_msg(log.str().c_str());
110 }
catch (std::exception &except) {
111 (*return_tuples) =
pgr_free(*return_tuples);
113 err << except.what();
114 *err_msg =
pgr_msg(err.str().c_str());
115 *log_msg =
pgr_msg(log.str().c_str());
117 (*return_tuples) =
pgr_free(*return_tuples);
119 err <<
"Caught unknown exception!";
120 *err_msg =
pgr_msg(err.str().c_str());
121 *log_msg =
pgr_msg(log.str().c_str());
References pgrouting::graph::Pgr_base_graph< G, T_V, T_E >::insert_edges(), pgassert, pgr_alloc(), pgr_free(), pgr_msg(), pgr_stoerWagner(), UNDIRECTED, and AssertFailedException::what().
Referenced by process().