PGROUTING  2.5
warshall.hpp File Reference
#include <string>
#include <vector>
#include "./../../warshall/src/pgr_warshall.hpp"
Include dependency graph for warshall.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename G >
void process_warshall (G &graph, const std::vector< std::string > &tokens)
 

Function Documentation

template<typename G >
void process_warshall ( G &  graph,
const std::vector< std::string > &  tokens 
)

Definition at line 27 of file warshall.hpp.

References matrix_cell::cost, matrix_cell::from_vid, and matrix_cell::to_vid.

Referenced by process().

27  {
28  std::string::size_type sz;
29 
30 
31  if (tokens.size() == 1) {
32  std::cout << "Performing warshall\n";
33  std::vector< Matrix_cell_t> matrix_rows;
34 
35  pgr_warshall(graph, matrix_rows);
36 
37  std::cout << "\t\t\tTHE OPUTPUT\n";
38  std::cout << "seq\tfrom\tto\tcost\n";
39  size_t seq = 0;
40  for (size_t i = 0; i < matrix_rows.size(); i++) {
41  std::cout << seq++ << "\t" << matrix_rows[i].from_vid << "\t" << matrix_rows[i].to_vid << "\t" << matrix_rows[i].cost << "\n";
42  }
43 #ifdef TEST_POSTGRES
44  size_t result_tuple_count;
45  Matrix_cell_t *postgres_rows = NULL;
46  pgr_warshall(graph, result_tuple_count, &postgres_rows);
47  std::cout << "\t\t\tTHE POSTGRESQL OPUTPUT\n";
48  std::cout << "seq\tfrom\tto\tcost\n";
49  seq = 0;
50  for (size_t i = 0; i < result_tuple_count; i++) {
51  std::cout << seq++ << "\t" << postgres_rows[i].from_vid << "\t" << postgres_rows[i].to_vid << "\t" << postgres_rows[i].cost << "\n";
52  }
53 #endif // TEST_POSTGRES
54  } else {
55  std::cout << "unknown number of parameters\n";
56  }
57 }
int64_t from_vid
Definition: matrix_cell_t.h:63
int64_t to_vid
Definition: matrix_cell_t.h:64

Here is the caller graph for this function: