|
PGROUTING
3.2
|
Go to the documentation of this file.
42 std::vector<pgr_stoerWagner_t>
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";
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());
T * pgr_alloc(std::size_t size, T *ptr)
allocates memory
std::vector< pgr_stoerWagner_t > stoerWagner(G &graph)
char * pgr_msg(const std::string &msg)
virtual const char * what() const
#define pgassert(expr)
Uses the standard assert syntax.
void insert_edges(const T *edges, size_t count)
Inserts count edges of type T into the graph.
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)
An assert functionality that uses C++ throw().
graph::Pgr_base_graph< BG, XY_vertex, Basic_edge > G
static std::vector< pgr_stoerWagner_t > pgr_stoerWagner(G &graph)
Extends std::exception and is the exception that we throw if an assert fails.