Go to the source code of this file.
|
void | do_pgr_bdAstar (Pgr_edge_xy_t *data_edges, size_t total_edges, 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, int heuristic, double factor, double epsilon, bool only_cost, General_path_element_t **return_tuples, size_t *return_count, char **log_msg, char **notice_msg, char **err_msg) |
|
◆ do_pgr_bdAstar()
void do_pgr_bdAstar |
( |
Pgr_edge_xy_t * |
data_edges, |
|
|
size_t |
total_edges, |
|
|
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, |
|
|
int |
heuristic, |
|
|
double |
factor, |
|
|
double |
epsilon, |
|
|
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 141 of file bdAstar_driver.cpp.
164 std::ostringstream log;
165 std::ostringstream err;
166 std::ostringstream notice;
176 log <<
"Inserting vertices into a c++ vector structure";
178 start_vertices(start_vidsArr, start_vidsArr + size_start_vidsArr);
179 std::vector< int64_t >
180 end_vertices(end_vidsArr, end_vidsArr + size_end_vidsArr);
181 std::vector< pgr_combination_t >
182 combinations_vector(combinations, combinations + total_combinations);
186 std::deque<Path> paths;
187 log <<
"starting process\n";
189 log <<
"Working with directed Graph\n";
193 digraph.insert_edges(edges, total_edges);
205 log <<
"Working with Undirected Graph\n";
209 undigraph.insert_edges(edges, total_edges);
227 (*return_tuples) = NULL;
231 *log_msg =
pgr_msg(notice.str().c_str());
235 (*return_tuples) =
pgr_alloc(count, (*return_tuples));
236 log <<
"\nConverting a set of paths into the tuples";
241 auto count = path.size();
244 (*return_tuples) = NULL;
247 "No paths found between start_vid and end_vid vertices";
249 (*return_tuples) =
pgr_alloc(count, (*return_tuples));
251 path.generate_postgres_data(return_tuples, sequence);
252 (*return_count) = sequence;
257 *log_msg = log.str().empty()?
260 *notice_msg = notice.str().empty()?
264 if (*return_tuples) free(*return_tuples);
266 err << except.
what();
267 *err_msg =
pgr_msg(err.str().c_str());
268 *log_msg =
pgr_msg(log.str().c_str());
269 }
catch (std::exception& except) {
270 if (*return_tuples) free(*return_tuples);
272 err << except.what();
273 *err_msg =
pgr_msg(err.str().c_str());
274 *log_msg =
pgr_msg(log.str().c_str());
276 if (*return_tuples) free(*return_tuples);
278 err <<
"Caught unknown exception!";
279 *err_msg =
pgr_msg(err.str().c_str());
280 *log_msg =
pgr_msg(log.str().c_str());
References collapse_paths(), count_tuples(), DIRECTED, pgrouting::extract_vertices(), pgrouting::graph::Pgr_base_graph< G, T_V, T_E >::insert_edges(), pgassert, pgr_alloc(), pgr_bdAstar(), pgr_msg(), UNDIRECTED, and AssertFailedException::what().
Referenced by process().