Go to the source code of this file.
|
void | do_pgr_bellman_ford (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_bellman_ford()
void do_pgr_bellman_ford |
( |
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 83 of file bellman_ford_driver.cpp.
100 std::ostringstream log;
101 std::ostringstream err;
102 std::ostringstream notice;
111 pgassert((start_vidsArr && end_vidsArr) || combinations);
112 pgassert((size_start_vidsArr && size_end_vidsArr) || total_combinations);
116 log <<
"Inserting vertices into a c++ vector structure";
118 start_vertices(start_vidsArr, start_vidsArr + size_start_vidsArr);
119 std::vector< int64_t >
120 end_vertices(end_vidsArr, end_vidsArr + size_end_vidsArr);
121 std::vector< pgr_combination_t >
122 combinations_vector(combinations, combinations + total_combinations);
124 std::deque< Path >paths;
127 log <<
"Working with directed Graph\n";
129 digraph.insert_edges(data_edges, total_edges);
137 log <<
"Working with Undirected Graph\n";
139 undigraph.insert_edges(data_edges, total_edges);
153 (*return_tuples) = NULL;
157 *log_msg =
pgr_msg(notice.str().c_str());
161 (*return_tuples) =
pgr_alloc(count, (*return_tuples));
162 log <<
"\nConverting a set of paths into the tuples";
165 *log_msg = log.str().empty()?
168 *notice_msg = notice.str().empty()?
172 (*return_tuples) =
pgr_free(*return_tuples);
174 err << except.
what();
175 *err_msg =
pgr_msg(err.str().c_str());
176 *log_msg =
pgr_msg(log.str().c_str());
177 }
catch (std::exception &except) {
178 (*return_tuples) =
pgr_free(*return_tuples);
180 err << except.what();
181 *err_msg =
pgr_msg(err.str().c_str());
182 *log_msg =
pgr_msg(log.str().c_str());
184 (*return_tuples) =
pgr_free(*return_tuples);
186 err <<
"Caught unknown exception!";
187 *err_msg =
pgr_msg(err.str().c_str());
188 *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_bellman_ford(), pgr_free(), pgr_msg(), UNDIRECTED, and AssertFailedException::what().
Referenced by process().