50 std::vector < pgr_combination_t > &combinations,
51 std::vector < int64_t > sources,
52 std::vector < int64_t > targets,
55 std::sort(sources.begin(), sources.end());
57 std::unique(sources.begin(), sources.end()),
60 std::sort(targets.begin(), targets.end());
62 std::unique(targets.begin(), targets.end()),
66 size_t n_goals = (std::numeric_limits<size_t>::max)();
67 auto paths = combinations.empty()?
68 fn_dijkstra.
dijkstra(graph, sources, targets, only_cost)
69 : fn_dijkstra.
dijkstra(graph, combinations, only_cost, n_goals);
72 for (
auto &path : paths) {
77 for (
auto &p : paths) {
78 p.recalculate_agg_cost();
96 pgr_edge_t *edges_of_points,
size_t total_edges_of_points,
100 int64_t *start_pidsArr,
size_t size_start_pidsArr,
101 int64_t *end_pidsArr,
size_t size_end_pidsArr,
114 std::ostringstream log;
115 std::ostringstream notice;
116 std::ostringstream err;
126 std::vector<Point_on_edge_t>(
128 points_p + total_points),
129 std::vector< pgr_edge_t >(
131 edges_of_points + total_edges_of_points),
139 *log_msg =
pgr_msg(log.str().c_str());
140 *err_msg =
pgr_msg(err.str().c_str());
145 std::vector<pgr_combination_t>
146 combinations_vector(combinations, combinations + total_combinations);
148 start_vertices(start_pidsArr, start_pidsArr + size_start_pidsArr);
149 std::vector< int64_t >
150 end_vertices(end_pidsArr, end_pidsArr + size_end_pidsArr);
157 std::deque< Path > paths;
160 log <<
"Working with directed Graph\n";
168 start_vertices, end_vertices,
171 log <<
"Working with Undirected Graph\n";
178 start_vertices, end_vertices,
183 for (
auto &path : paths) {
191 std::sort(paths.begin(), paths.end(),
194 if (b.start_id() != a.start_id()) {
195 return a.start_id() < b.start_id();
205 (*return_tuples) = NULL;
210 (*return_tuples) =
pgr_alloc(count, (*return_tuples));
211 log <<
"Converting a set of paths into the tuples\n";
214 log <<
"************************************************";
215 log << pg_graph.get_log();
216 log <<
"************************************************";
218 *log_msg = log.str().empty()?
221 *notice_msg = notice.str().empty()?
225 (*return_tuples) =
pgr_free(*return_tuples);
227 err << except.
what();
228 *err_msg =
pgr_msg(err.str().c_str());
229 *log_msg =
pgr_msg(log.str().c_str());
230 }
catch (std::exception &except) {
231 (*return_tuples) =
pgr_free(*return_tuples);
233 err << except.what();
234 *err_msg =
pgr_msg(err.str().c_str());
235 *log_msg =
pgr_msg(log.str().c_str());
237 (*return_tuples) =
pgr_free(*return_tuples);
239 err <<
"Caught unknown exception!";
240 *err_msg =
pgr_msg(err.str().c_str());
241 *log_msg =
pgr_msg(log.str().c_str());