PGROUTING  2.5
testit.cpp File Reference
#include <stdio.h>
#include <vector>
#include "GraphDefinition.h"
#include "utils.h"
#include "issue191-bad-m1.h"
Include dependency graph for testit.cpp:

Go to the source code of this file.

Functions

int main (void)
 

Function Documentation

int main ( void  )

Definition at line 33 of file testit.cpp.

References edges, GraphDefinition::my_dijkstra(), and NEDGE.

33  {
34  path_element_t *path;
35  int path_count;
36  char *err_msg;
37 
38  std::vector<PDVI> ruleTable;
39  ruleTable.clear();
40 
41  GraphDefinition gdef;
42  int res = gdef.my_dijkstra(edges, NEDGE, 2963487, 0.5, 3345813, 0.5, &path, &path_count, &err_msg, ruleTable);
43 
44  if (res < 0) {
45  printf("error: res: %d\n", res);
46  printf("%s\n", err_msg);
47  return 1;
48  }
49 
50  printf("Path count: %d\n", path_count);
51 
52  float8 tcost = 0.0;
53  for (int i=0; i<path_count; i++) {
54  printf("%4d: %7d, %7d, %.4f\n", i+1, path[i].vertex_id, path[i].edge_id, path[i].cost);
55  tcost += path[i].cost;
56  }
57  printf("\nTotal cost = %.4f\n", tcost);
58 
59  return 0;
60 }
static edge_t edges[22573]
int my_dijkstra(long start_vertex, long end_vertex, size_t edge_count, char **err_msg)
double float8
Definition: postgres.h:23
#define NEDGE

Here is the call graph for this function: