Go to the source code of this file.
|
void | do_pgr_ksp (pgr_edge_t *data_edges, size_t total_edges, int64_t start_vid, int64_t end_vid, size_t K, bool directed, bool heap_paths, General_path_element_t **return_tuples, size_t *return_count, char **log_msg, char **notice_msg, char **err_msg) |
|
◆ do_pgr_ksp()
void do_pgr_ksp |
( |
pgr_edge_t * |
data_edges, |
|
|
size_t |
total_edges, |
|
|
int64_t |
start_vid, |
|
|
int64_t |
end_vid, |
|
|
size_t |
K, |
|
|
bool |
directed, |
|
|
bool |
heap_paths, |
|
|
General_path_element_t ** |
return_tuples, |
|
|
size_t * |
return_count, |
|
|
char ** |
log_msg, |
|
|
char ** |
notice_msg, |
|
|
char ** |
err_msg |
|
) |
| |
Definition at line 43 of file ksp_driver.cpp.
56 std::ostringstream err;
57 std::ostringstream log;
58 std::ostringstream notice;
69 std::deque< Path > paths;
74 digraph.insert_edges(data_edges, total_edges);
75 paths = fn_yen.
Yen(digraph, start_vid, end_vid, k, heap_paths);
79 undigraph.insert_edges(data_edges, total_edges);
80 paths = fn_yen.
Yen(undigraph, start_vid, end_vid, k, heap_paths);
87 *return_tuples = NULL;
88 *return_tuples =
pgr_alloc(count, (*return_tuples));
92 for (
const auto &path : paths) {
94 path.get_pg_ksp_path(return_tuples, sequence, route_id);
98 *return_count = count;
101 *log_msg = log.str().empty()?
104 *notice_msg = notice.str().empty()?
108 (*return_tuples) =
pgr_free(*return_tuples);
110 err << except.
what();
111 *err_msg =
pgr_msg(err.str().c_str());
112 *log_msg =
pgr_msg(log.str().c_str());
113 }
catch (std::exception &except) {
114 (*return_tuples) =
pgr_free(*return_tuples);
116 err << except.what();
117 *err_msg =
pgr_msg(err.str().c_str());
118 *log_msg =
pgr_msg(log.str().c_str());
120 (*return_tuples) =
pgr_free(*return_tuples);
122 err <<
"Caught unknown exception!";
123 *err_msg =
pgr_msg(err.str().c_str());
124 *log_msg =
pgr_msg(log.str().c_str());
References count_tuples(), DIRECTED, pgrouting::graph::Pgr_base_graph< G, T_V, T_E >::insert_edges(), pgassert, pgr_alloc(), pgr_free(), pgr_msg(), UNDIRECTED, AssertFailedException::what(), and pgrouting::yen::Pgr_ksp< G >::Yen().
Referenced by compute().