PGROUTING  2.5
johnson_driver.h File Reference
Include dependency graph for johnson_driver.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

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 **err_msg)
 

Function Documentation

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 **  err_msg 
)

Definition at line 41 of file johnson_driver.cpp.

References DIRECTED, pgrouting::graph::Pgr_base_graph< G, T_V, T_E >::insert_edges(), pgr_johnson(), and UNDIRECTED.

Referenced by process().

47  {
48  std::ostringstream log;
49  try {
50  if (total_tuples == 1) {
51  log << "Required: more than one tuple\n";
52  (*return_tuples) = NULL;
53  (*return_count) = 0;
54  *err_msg = strdup(log.str().c_str());
55  return;
56  }
57 
58  graphType gType = directed? DIRECTED: UNDIRECTED;
59 
60  std::deque< Path >paths;
61 
62  if (directed) {
63  log << "Working with directed Graph\n";
64  pgrouting::DirectedGraph digraph(gType);
65  digraph.insert_edges(data_edges, total_tuples);
66  pgr_johnson(digraph, *return_count, return_tuples);
67  } else {
68  log << "Working with Undirected Graph\n";
69  pgrouting::UndirectedGraph undigraph(gType);
70  undigraph.insert_edges(data_edges, total_tuples);
71  pgr_johnson(undigraph, *return_count, return_tuples);
72  }
73 
74  if (*return_count == 0) {
75  log << "NOTICE: No Vertices found??? wiered error\n";
76  *err_msg = strdup(log.str().c_str());
77  (*return_tuples) = NULL;
78  (*return_count) = 0;
79  return;
80  }
81 
82 #ifndef DEBUG
83  *err_msg = strdup("OK");
84 #else
85  *err_msg = strdup(log.str().c_str());
86 #endif
87  } catch ( ... ) {
88  log << "Caught unknown exception!\n";
89  *err_msg = strdup(log.str().c_str());
90  }
91 }
graphType
Definition: graph_enum.h:30
void pgr_johnson(G &graph, std::vector< Matrix_cell_t > &rows)

Here is the call graph for this function:

Here is the caller graph for this function: