#include <stddef.h>
#include "c_types/pgr_edge_t.h"
#include "c_types/pgr_mst_rt.h"
Go to the source code of this file.
|
void | do_pgr_breadthFirstSearch (pgr_edge_t *data_edges, size_t total_tuples, int64_t *start_vidsArr, size_t size_start_vidsArr, int64_t max_depth, bool directed, pgr_mst_rt **return_tuples, size_t *return_count, char **log_msg, char **notice_msg, char **err_msg) |
|
◆ do_pgr_breadthFirstSearch()
void do_pgr_breadthFirstSearch |
( |
pgr_edge_t * |
data_edges, |
|
|
size_t |
total_tuples, |
|
|
int64_t * |
start_vidsArr, |
|
|
size_t |
size_start_vidsArr, |
|
|
int64_t |
max_depth, |
|
|
bool |
directed, |
|
|
pgr_mst_rt ** |
return_tuples, |
|
|
size_t * |
return_count, |
|
|
char ** |
log_msg, |
|
|
char ** |
notice_msg, |
|
|
char ** |
err_msg |
|
) |
| |
Definition at line 60 of file breadthFirstSearch_driver.cpp.
73 std::ostringstream log;
74 std::ostringstream err;
75 std::ostringstream notice;
86 log <<
"Inserting vertices into a c++ vector structure";
88 start_vertices(start_vidsArr, start_vidsArr + size_start_vidsArr);
90 std::vector<pgr_mst_rt> results;
92 log <<
"Working with directed Graph\n";
94 digraph.insert_edges(data_edges, total_edges);
101 log <<
"Working with Undirected Graph\n";
103 undigraph.insert_edges(data_edges, total_edges);
111 auto count = results.size();
114 (*return_tuples) = NULL;
117 "No traversal found";
118 *log_msg =
pgr_msg(notice.str().c_str());
122 (*return_tuples) =
pgr_alloc(count, (*return_tuples));
123 log <<
"\nConverting a set of traversals into the tuples";
124 for (
size_t i = 0; i < count; i++) {
125 *((*return_tuples) + i) = results[i];
127 (*return_count) = count;
130 *log_msg = log.str().empty()?
133 *notice_msg = notice.str().empty()?
137 (*return_tuples) =
pgr_free(*return_tuples);
139 err << except.
what();
140 *err_msg =
pgr_msg(err.str().c_str());
141 *log_msg =
pgr_msg(log.str().c_str());
142 }
catch (std::exception &except) {
143 (*return_tuples) =
pgr_free(*return_tuples);
145 err << except.what();
146 *err_msg =
pgr_msg(err.str().c_str());
147 *log_msg =
pgr_msg(log.str().c_str());
149 (*return_tuples) =
pgr_free(*return_tuples);
151 err <<
"Caught unknown exception!";
152 *err_msg =
pgr_msg(err.str().c_str());
153 *log_msg =
pgr_msg(log.str().c_str());
References DIRECTED, pgrouting::graph::Pgr_base_graph< G, T_V, T_E >::insert_edges(), pgassert, pgr_alloc(), pgr_breadthFirstSearch(), pgr_free(), pgr_msg(), UNDIRECTED, and AssertFailedException::what().
Referenced by process().