PGROUTING
3.2
|
Handles actual calling of function in the pgr_depthFirstSearch.hpp
file.
More...
#include "drivers/traversal/depthFirstSearch_driver.h"
#include <vector>
#include <algorithm>
#include <string>
#include "cpp_common/pgr_alloc.hpp"
#include "cpp_common/pgr_assert.h"
#include "traversal/pgr_depthFirstSearch.hpp"
Go to the source code of this file.
Functions | |
void | do_pgr_depthFirstSearch (pgr_edge_t *data_edges, size_t total_edges, int64_t *rootsArr, size_t size_rootsArr, bool directed, int64_t max_depth, pgr_mst_rt **return_tuples, size_t *return_count, char **log_msg, char **notice_msg, char **err_msg) |
Performs exception handling and converts the results to postgres. More... | |
template<class G > | |
std::vector< pgr_mst_rt > | pgr_depthFirstSearch (G &graph, std::vector< int64_t > roots, bool directed, int64_t max_depth) |
Calls the main function defined in the C++ Header file. More... | |
Handles actual calling of function in the pgr_depthFirstSearch.hpp
file.
Definition in file depthFirstSearch_driver.cpp.
void do_pgr_depthFirstSearch | ( | pgr_edge_t * | data_edges, |
size_t | total_edges, | ||
int64_t * | rootsArr, | ||
size_t | size_rootsArr, | ||
bool | directed, | ||
int64_t | max_depth, | ||
pgr_mst_rt ** | return_tuples, | ||
size_t * | return_count, | ||
char ** | log_msg, | ||
char ** | notice_msg, | ||
char ** | err_msg | ||
) |
Performs exception handling and converts the results to postgres.
It builds the graph using the data_edges
, depending on whether the graph is directed or undirected. It also converts the C types to the C++ types, such as the rootsArr
to roots
vector and passes these variables to the template function pgr_depthFirstSearch
which calls the main function defined in the C++ Header file. It also does exception handling.
data_edges | the set of edges from the SQL query |
total_edges | the total number of edges in the SQL query |
rootsArr | the array containing the root vertices |
size_rootsArr | the size of the array containing the root vertices |
directed | whether the graph is directed or undirected |
max_depth | the maximum depth of traversal |
return_tuples | the rows in the result |
return_count | the count of rows in the result |
log_msg | stores the log message |
notice_msg | stores the notice message |
err_msg | stores the error message |
Definition at line 118 of file depthFirstSearch_driver.cpp.
References DIRECTED, pgrouting::graph::Pgr_base_graph< G, T_V, T_E >::insert_edges(), pgassert, pgr_alloc(), pgr_depthFirstSearch(), pgr_free(), pgr_msg(), UNDIRECTED, and AssertFailedException::what().
Referenced by process().
std::vector< pgr_mst_rt > pgr_depthFirstSearch | ( | G & | graph, |
std::vector< int64_t > | roots, | ||
bool | directed, | ||
int64_t | max_depth | ||
) |
Calls the main function defined in the C++ Header file.
Also sorts the root vertices in an increasing order, and removes the duplicated vertices. Then calls the function defined in the C++ Header file - pgr_depthFirstSearch.hpp
graph | the graph containing the edges |
roots | the root vertices |
directed | whether the graph is directed or undirected |
max_depth | the maximum depth of traversal |
log | stores the log message |
Definition at line 73 of file depthFirstSearch_driver.cpp.
References pgrouting::functions::Pgr_depthFirstSearch< G >::depthFirstSearch().
Referenced by do_pgr_depthFirstSearch().