#include <stddef.h>
#include "c_types/pgr_basic_edge_t.h"
Go to the source code of this file.
◆ do_pgr_maximum_cardinality_matching()
void do_pgr_maximum_cardinality_matching |
( |
pgr_basic_edge_t * |
data_edges, |
|
|
size_t |
total_edges, |
|
|
bool |
directed, |
|
|
pgr_basic_edge_t ** |
return_tuples, |
|
|
size_t * |
return_count, |
|
|
char ** |
log_msg, |
|
|
char ** |
notice_msg, |
|
|
char ** |
err_msg |
|
) |
| |
Definition at line 42 of file maximum_cardinality_matching_driver.cpp.
53 std::ostringstream log;
54 std::ostringstream notice;
55 std::ostringstream err;
58 std::vector<pgr_basic_edge_t> matched_vertices;
62 matched_vertices =
G.get_matched_vertices();
65 matched_vertices =
G.get_matched_vertices();
68 (*return_tuples) =
pgr_alloc(matched_vertices.size(), (*return_tuples));
69 for (
size_t i = 0; i < matched_vertices.size(); ++i) {
70 (*return_tuples)[i] = matched_vertices[i];
72 *return_count = matched_vertices.size();
74 *log_msg = log.str().empty()?
77 *notice_msg = notice.str().empty()?
81 (*return_tuples) =
pgr_free(*return_tuples);
84 *err_msg =
pgr_msg(err.str().c_str());
85 *log_msg =
pgr_msg(log.str().c_str());
86 }
catch (std::exception &except) {
87 (*return_tuples) =
pgr_free(*return_tuples);
90 *err_msg =
pgr_msg(err.str().c_str());
91 *log_msg =
pgr_msg(log.str().c_str());
93 (*return_tuples) =
pgr_free(*return_tuples);
95 err <<
"Caught unknown exception!";
96 *err_msg =
pgr_msg(err.str().c_str());
97 *log_msg =
pgr_msg(log.str().c_str());
References pgr_alloc(), pgr_free(), pgr_msg(), and AssertFailedException::what().
Referenced by process().