#include <stddef.h>
#include "c_types/pgr_edge_t.h"
#include "c_types/matrix_cell_t.h"
Go to the source code of this file.
◆ do_pgr_johnson()
void do_pgr_johnson |
( |
pgr_edge_t * |
data_edges, |
|
|
size_t |
total_tuples, |
|
|
bool |
directed, |
|
|
Matrix_cell_t ** |
return_tuples, |
|
|
size_t * |
return_count, |
|
|
char ** |
log_msg, |
|
|
char ** |
err_msg |
|
) |
| |
Definition at line 42 of file johnson_driver.cpp.
50 std::ostringstream log;
51 std::ostringstream err;
62 log <<
"Processing Directed graph\n";
64 digraph.insert_edges(data_edges, total_tuples);
67 log <<
"Processing Undirected graph\n";
69 undigraph.insert_edges(data_edges, total_tuples);
70 pgr_johnson(undigraph, *return_count, return_tuples);
74 if (*return_count == 0) {
75 log <<
"No result generated, report this error\n";
76 *log_msg =
pgr_msg(err.str().c_str());
77 *return_tuples = NULL;
83 *log_msg = log.str().empty()?
87 (*return_tuples) =
pgr_free(*return_tuples);
90 *err_msg =
pgr_msg(err.str().c_str());
91 *log_msg =
pgr_msg(log.str().c_str());
92 }
catch (std::exception &except) {
93 (*return_tuples) =
pgr_free(*return_tuples);
96 *err_msg =
pgr_msg(err.str().c_str());
97 *log_msg =
pgr_msg(log.str().c_str());
99 (*return_tuples) =
pgr_free(*return_tuples);
101 err <<
"Caught unknown exception!";
102 *err_msg =
pgr_msg(err.str().c_str());
103 *log_msg =
pgr_msg(log.str().c_str());
References DIRECTED, pgrouting::graph::Pgr_base_graph< G, T_V, T_E >::insert_edges(), pgassert, pgr_free(), pgr_johnson(), pgr_msg(), UNDIRECTED, and AssertFailedException::what().
Referenced by process().