60 std::vector <pgr_combination_t> &combinations,
61 std::vector < int64_t > sources,
62 std::vector < int64_t > targets) {
63 std::sort(sources.begin(), sources.end());
65 std::unique(sources.begin(), sources.end()),
68 std::sort(targets.begin(), targets.end());
70 std::unique(targets.begin(), targets.end()),
74 auto paths = combinations.empty() ?
86 size_t total_combinations,
87 int64_t *start_vidsArr,
88 size_t size_start_vidsArr,
90 size_t size_end_vidsArr,
98 std::ostringstream log;
99 std::ostringstream err;
100 std::ostringstream notice;
110 pgassert((start_vidsArr && end_vidsArr) || combinations);
111 pgassert((size_start_vidsArr && size_end_vidsArr) || total_combinations);
115 log <<
"Inserting vertices into a c++ vector structure";
117 start_vertices(start_vidsArr, start_vidsArr + size_start_vidsArr);
118 std::vector< int64_t >
119 end_vertices(end_vidsArr, end_vidsArr + size_end_vidsArr);
120 std::vector< pgr_combination_t >
121 combinations_vector(combinations, combinations + total_combinations);
124 std::deque< Path >paths;
126 log <<
"\nWorking with directed Graph";
135 log <<
"\nWorking with Undirected Graph";
150 (*return_tuples) = NULL;
154 *log_msg =
pgr_msg(notice.str().c_str());
158 (*return_tuples) =
pgr_alloc(count, (*return_tuples));
159 log <<
"\nConverting a set of paths into the tuples";
162 *log_msg = log.str().empty()?
165 *notice_msg = notice.str().empty()?
169 (*return_tuples) =
pgr_free(*return_tuples);
171 err << except.
what();
172 *err_msg =
pgr_msg(err.str().c_str());
173 *log_msg =
pgr_msg(log.str().c_str());
174 }
catch (std::exception &except) {
175 (*return_tuples) =
pgr_free(*return_tuples);
177 err << except.what();
178 *err_msg =
pgr_msg(err.str().c_str());
179 *log_msg =
pgr_msg(log.str().c_str());
181 (*return_tuples) =
pgr_free(*return_tuples);
183 err <<
"Caught unknown exception!";
184 *err_msg =
pgr_msg(err.str().c_str());
185 *log_msg =
pgr_msg(log.str().c_str());