Go to the source code of this file.
|
void | do_pgr_dagShortestPath (pgr_edge_t *data_edges, size_t total_tuples, pgr_combination_t *combinations, size_t total_combinations, int64_t *start_vidsArr, size_t size_start_vidsArr, int64_t *end_vidsArr, size_t size_end_vidsArr, bool directed, bool only_cost, General_path_element_t **return_tuples, size_t *return_count, char **log_msg, char **notice_msg, char **err_msg) |
|
◆ do_pgr_dagShortestPath()
void do_pgr_dagShortestPath |
( |
pgr_edge_t * |
data_edges, |
|
|
size_t |
total_tuples, |
|
|
pgr_combination_t * |
combinations, |
|
|
size_t |
total_combinations, |
|
|
int64_t * |
start_vidsArr, |
|
|
size_t |
size_start_vidsArr, |
|
|
int64_t * |
end_vidsArr, |
|
|
size_t |
size_end_vidsArr, |
|
|
bool |
directed, |
|
|
bool |
only_cost, |
|
|
General_path_element_t ** |
return_tuples, |
|
|
size_t * |
return_count, |
|
|
char ** |
log_msg, |
|
|
char ** |
notice_msg, |
|
|
char ** |
err_msg |
|
) |
| |
Definition at line 74 of file dagShortestPath_driver.cpp.
91 std::ostringstream log;
92 std::ostringstream err;
93 std::ostringstream notice;
102 pgassert((start_vidsArr && end_vidsArr) || combinations);
103 pgassert((size_start_vidsArr && size_end_vidsArr) || total_combinations);
107 log <<
"Inserting vertices into a c++ vector structure";
109 start_vertices(start_vidsArr, start_vidsArr + size_start_vidsArr);
110 std::vector< int64_t >
111 end_vertices(end_vidsArr, end_vidsArr + size_end_vidsArr);
112 std::vector< pgr_combination_t >
113 combinations_vector(combinations, combinations + total_combinations);
115 std::deque< Path >paths;
118 log <<
"Working with directed Graph\n";
120 digraph.insert_edges(data_edges, total_edges);
127 log <<
"Working with Undirected Graph\n";
129 undigraph.insert_edges(data_edges, total_edges);
142 (*return_tuples) = NULL;
145 "No paths found between start_vid and end_vid vertices";
149 (*return_tuples) =
pgr_alloc(count, (*return_tuples));
150 log <<
"\nConverting a set of paths into the tuples";
153 *log_msg = log.str().empty()?
156 *notice_msg = notice.str().empty()?
160 (*return_tuples) =
pgr_free(*return_tuples);
162 err << except.
what();
163 *err_msg =
pgr_msg(err.str().c_str());
164 *log_msg =
pgr_msg(log.str().c_str());
165 }
catch (std::exception &except) {
166 (*return_tuples) =
pgr_free(*return_tuples);
168 err << except.what();
169 *err_msg =
pgr_msg(err.str().c_str());
170 *log_msg =
pgr_msg(log.str().c_str());
172 (*return_tuples) =
pgr_free(*return_tuples);
174 err <<
"Caught unknown exception!";
175 *err_msg =
pgr_msg(err.str().c_str());
176 *log_msg =
pgr_msg(log.str().c_str());
References collapse_paths(), count_tuples(), DIRECTED, pgrouting::graph::Pgr_base_graph< G, T_V, T_E >::insert_edges(), pgassert, pgr_alloc(), pgr_dagShortestPath(), pgr_free(), pgr_msg(), UNDIRECTED, and AssertFailedException::what().
Referenced by process().