PGROUTING  2.6-dev
trsp_core.cpp File Reference
Include dependency graph for trsp_core.cpp:

Go to the source code of this file.

Functions

int trsp_edge_wrapper (edge_t *edges, size_t edge_count, restrict_t *restricts, size_t restrict_count, int64_t start_edge, double start_pos, int64_t end_edge, double end_pos, bool directed, bool has_reverse_cost, path_element_tt **path, size_t *path_count, char **err_msg)
 
int trsp_node_wrapper (edge_t *edges, size_t edge_count, restrict_t *restricts, size_t restrict_count, int64_t start_vertex, int64_t end_vertex, bool directed, bool has_reverse_cost, path_element_tt **path, size_t *path_count, char **err_msg)
 

Function Documentation

int trsp_edge_wrapper ( edge_t edges,
size_t  edge_count,
restrict_t restricts,
size_t  restrict_count,
int64_t  start_edge,
double  start_pos,
int64_t  end_edge,
double  end_pos,
bool  directed,
bool  has_reverse_cost,
path_element_tt **  path,
size_t *  path_count,
char **  err_msg 
)

Definition at line 83 of file trsp_core.cpp.

References MAX_RULE_LENGTH, GraphDefinition::my_dijkstra(), and restrict_struct::via.

Referenced by compute_trsp().

97  {
98  try {
99  std::vector<PDVI> ruleTable;
100 
101  size_t i, j;
102  ruleTable.clear();
103  for (i = 0; i < restrict_count; i++) {
104  std::vector<long> seq;
105  seq.clear();
106  seq.push_back(restricts[i].target_id);
107  for (j = 0; j < MAX_RULE_LENGTH && restricts[i].via[j] >- 1; j++) {
108  seq.push_back(restricts[i].via[j]);
109  }
110  ruleTable.push_back(make_pair(restricts[i].to_cost, seq));
111  }
112 
113  GraphDefinition gdef;
114  auto res = gdef.my_dijkstra(edges, edge_count, start_edge, start_pos,
115  end_edge, end_pos, directed, has_reverse_cost, path, path_count,
116  err_msg, ruleTable);
117 
118 
119  if (res < 0)
120  return res;
121  else
122  return EXIT_SUCCESS;
123  }
124  catch(std::exception& e) {
125  *err_msg = (char *) e.what();
126  return -1;
127  }
128  catch(...) {
129  *err_msg = (char *) "Caught unknown exception!";
130  return -1;
131  }
132 }
int via[5]
Definition: trsp.h:42
int my_dijkstra(long start_vertex, long end_vertex, size_t edge_count, char **err_msg)
#define MAX_RULE_LENGTH
Definition: trsp.h:25

Here is the call graph for this function:

Here is the caller graph for this function:

int trsp_node_wrapper ( edge_t edges,
size_t  edge_count,
restrict_t restricts,
size_t  restrict_count,
int64_t  start_vertex,
int64_t  end_vertex,
bool  directed,
bool  has_reverse_cost,
path_element_tt **  path,
size_t *  path_count,
char **  err_msg 
)

Definition at line 35 of file trsp_core.cpp.

References MAX_RULE_LENGTH, GraphDefinition::my_dijkstra(), and restrict_struct::via.

Referenced by compute_trsp().

47  {
48  try {
49  std::vector<PDVI> ruleTable;
50 
51  size_t i, j;
52  ruleTable.clear();
53  for (i = 0; i < restrict_count; i++) {
54  std::vector<long> seq;
55  seq.clear();
56  seq.push_back(restricts[i].target_id);
57  for (j = 0; j < MAX_RULE_LENGTH && restricts[i].via[j] > -1; j++) {
58  seq.push_back(restricts[i].via[j]);
59  }
60  ruleTable.push_back(make_pair(restricts[i].to_cost, seq));
61  }
62 
63  GraphDefinition gdef;
64  int res = gdef.my_dijkstra(edges, edge_count, start_vertex, end_vertex,
65  directed, has_reverse_cost, path, path_count, err_msg, ruleTable);
66 
67 
68  if (res < 0)
69  return res;
70  else
71  return EXIT_SUCCESS;
72  }
73  catch(std::exception& e) {
74  *err_msg = (char *) e.what();
75  return -1;
76  }
77  catch(...) {
78  *err_msg = (char *) "Caught unknown exception!";
79  return -1;
80  }
81 }
int via[5]
Definition: trsp.h:42
int my_dijkstra(long start_vertex, long end_vertex, size_t edge_count, char **err_msg)
#define MAX_RULE_LENGTH
Definition: trsp.h:25

Here is the call graph for this function:

Here is the caller graph for this function: