PGROUTING  2.5
floydWarshall_driver.h File Reference
Include dependency graph for floydWarshall_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_floydWarshall (pgr_edge_t *data_edges, size_t total_tuples, bool directedFlag, Matrix_cell_t **ret_matrix, size_t *return_tuple_count, char **log_msg, char **err_msg)
 

Function Documentation

void do_pgr_floydWarshall ( pgr_edge_t data_edges,
size_t  total_tuples,
bool  directedFlag,
Matrix_cell_t **  ret_matrix,
size_t *  return_tuple_count,
char **  log_msg,
char **  err_msg 
)

Definition at line 42 of file floydWarshall_driver.cpp.

References DIRECTED, pgrouting::graph::Pgr_base_graph< G, T_V, T_E >::insert_edges(), pgassert, pgr_floydWarshall(), UNDIRECTED, and AssertFailedException::what().

Referenced by process().

51  {
52  // function starts
53  std::ostringstream log;
54  try {
55  pgassert(!(*log_msg));
56  pgassert(!(*err_msg));
57  pgassert(!(*return_tuples));
58  pgassert(*return_count == 0);
59 
60  graphType gType = directedFlag? DIRECTED: UNDIRECTED;
61 
62 
63  if (directedFlag) {
64  log << "Processing Directed graph\n";
65  pgrouting::DirectedGraph digraph(gType);
66  digraph.insert_edges(data_edges, total_tuples);
67  log << digraph;
68  pgr_floydWarshall(digraph, *return_count, return_tuples);
69  } else {
70  log << "Processing Undirected graph\n";
71  pgrouting::UndirectedGraph undigraph(gType);
72  undigraph.insert_edges(data_edges, total_tuples);
73  log << undigraph;
74  pgr_floydWarshall(undigraph, *return_count, return_tuples);
75  }
76 
77 
78  if (*return_count == 0) {
79  log << "NOTICE: No Vertices found??? wiered error\n";
80  *err_msg = strdup(log.str().c_str());
81  *return_tuples = NULL;
82  *return_count = 0;
83  return;
84  }
85 
86  *log_msg = strdup(log.str().c_str());
87  return;
88  } catch (AssertFailedException &except) {
89  if (*return_tuples) free(*return_tuples);
90  (*return_count) = 0;
91  log << except.what() << "\n";
92  *err_msg = strdup(log.str().c_str());
93  } catch (std::exception& except) {
94  if (*return_tuples) free(*return_tuples);
95  (*return_count) = 0;
96  log << except.what() << "\n";
97  *err_msg = strdup(log.str().c_str());
98  } catch(...) {
99  if (*return_tuples) free(*return_tuples);
100  (*return_count) = 0;
101  log << "Caught unknown exception!\n";
102  *err_msg = strdup(log.str().c_str());
103  }
104 }
Extends std::exception and is the exception that we throw if an assert fails.
Definition: pgr_assert.h:126
#define pgassert(expr)
Uses the standard assert syntax.
Definition: pgr_assert.h:81
virtual const char * what() const
Definition: pgr_assert.cpp:53
void pgr_floydWarshall(G &graph, std::vector< Matrix_cell_t > &rows)
graphType
Definition: graph_enum.h:30

Here is the call graph for this function:

Here is the caller graph for this function: