49 std::vector <pgr_combination_t> &combinations,
50 std::vector < int64_t > sources,
51 std::vector < int64_t > targets,
52 bool only_cost =
false) {
53 std::sort(sources.begin(), sources.end());
55 std::unique(sources.begin(), sources.end()),
58 std::sort(targets.begin(), targets.end());
60 std::unique(targets.begin(), targets.end()),
65 auto paths = combinations.empty() ?
66 fn_dag.
dag(graph, sources, targets, only_cost)
67 : fn_dag.
dag(graph, combinations, only_cost);
78 size_t total_combinations,
79 int64_t *start_vidsArr,
80 size_t size_start_vidsArr,
82 size_t size_end_vidsArr,
91 std::ostringstream log;
92 std::ostringstream err;
93 std::ostringstream notice;
102 pgassert((start_vidsArr && end_vidsArr) || combinations);
103 pgassert((size_start_vidsArr && size_end_vidsArr) || total_combinations);
107 log <<
"Inserting vertices into a c++ vector structure";
109 start_vertices(start_vidsArr, start_vidsArr + size_start_vidsArr);
110 std::vector< int64_t >
111 end_vertices(end_vidsArr, end_vidsArr + size_end_vidsArr);
112 std::vector< pgr_combination_t >
113 combinations_vector(combinations, combinations + total_combinations);
115 std::deque< Path >paths;
118 log <<
"Working with directed Graph\n";
127 log <<
"Working with Undirected Graph\n";
142 (*return_tuples) = NULL;
145 "No paths found between start_vid and end_vid vertices";
149 (*return_tuples) =
pgr_alloc(count, (*return_tuples));
150 log <<
"\nConverting a set of paths into the tuples";
153 *log_msg = log.str().empty()?
156 *notice_msg = notice.str().empty()?
160 (*return_tuples) =
pgr_free(*return_tuples);
162 err << except.
what();
163 *err_msg =
pgr_msg(err.str().c_str());
164 *log_msg =
pgr_msg(log.str().c_str());
165 }
catch (std::exception &except) {
166 (*return_tuples) =
pgr_free(*return_tuples);
168 err << except.what();
169 *err_msg =
pgr_msg(err.str().c_str());
170 *log_msg =
pgr_msg(log.str().c_str());
172 (*return_tuples) =
pgr_free(*return_tuples);
174 err <<
"Caught unknown exception!";
175 *err_msg =
pgr_msg(err.str().c_str());
176 *log_msg =
pgr_msg(log.str().c_str());