92 std::ostringstream log;
93 std::ostringstream err;
94 std::ostringstream notice;
107 std::deque<Path> paths;
108 std::vector<int64_t> start_vertices(start_vertex, start_vertex + s_len);
115 std::chrono::steady_clock::time_point begin_elapsed;
120 start_timing(start_t, begin_elapsed, begin);
121 log <<
"*********Creating graph at time: " << std::ctime(&start_t) <<
"\n";
125 end_timing(start_t, begin_elapsed, begin, log);
129 start_timing(start_t, begin_elapsed, begin);
130 log <<
"********Inserting edges at time: " << std::ctime(&start_t) <<
"\n";
132 digraph.insert_edges(data_edges, total_edges,
true);
134 end_timing(start_t, begin_elapsed, begin, log);
138 start_timing(start_t, begin_elapsed, begin);
139 log <<
"*******Calling the C++ call to pgr_drivingDistance: " << std::ctime(&start_t) <<
"\n";
142 digraph, start_vertices, distance, equiCostFlag, log);
144 end_timing(start_t, begin_elapsed, begin, log);
148 start_timing(start_t, begin_elapsed, begin);
149 log <<
"******Creating graph at time: " << std::ctime(&start_t) <<
"\n";
153 end_timing(start_t, begin_elapsed, begin, log);
157 start_timing(start_t, begin_elapsed, begin);
158 log <<
"*******Inserting edges at time: " << std::ctime(&start_t) <<
"\n";
160 undigraph.insert_edges(data_edges, total_edges,
true);
162 end_timing(start_t, begin_elapsed, begin, log);
166 start_timing(start_t, begin_elapsed, begin);
167 log <<
"*******Calling the C++ call to pgr_drivingDistance: " << std::ctime(&start_t) <<
"\n";
170 undigraph, start_vertices, distance, equiCostFlag, log);
172 end_timing(start_t, begin_elapsed, begin, log);
180 log <<
"\nNo return values were found";
181 *notice_msg =
pgr_msg(log.str().c_str());
184 *return_tuples =
pgr_alloc(count, (*return_tuples));
186 *return_count = trueCount;
189 *log_msg = log.str().empty()?
192 *notice_msg = notice.str().empty()?
196 (*return_tuples) =
pgr_free(*return_tuples);
198 err << except.
what();
199 *err_msg =
pgr_msg(err.str().c_str());
200 *log_msg =
pgr_msg(log.str().c_str());
201 }
catch (std::exception &except) {
202 (*return_tuples) =
pgr_free(*return_tuples);
204 err << except.what();
205 *err_msg =
pgr_msg(err.str().c_str());
206 *log_msg =
pgr_msg(log.str().c_str());
208 (*return_tuples) =
pgr_free(*return_tuples);
210 err <<
"Caught unknown exception!";
211 *err_msg =
pgr_msg(err.str().c_str());
212 *log_msg =
pgr_msg(log.str().c_str());
Extends std::exception and is the exception that we throw if an assert fails.
size_t collapse_paths(General_path_element_t **ret_path, const std::deque< Path > &paths)
#define pgassert(expr)
Uses the standard assert syntax.
std::deque< Path > pgr_drivingDistance(G &graph, std::vector< int64_t > start_vids, double distance, bool equicost, std::ostringstream &log)
std::vector< Basic_vertex > extract_vertices(std::vector< Basic_vertex > vertices, const std::vector< pgr_edge_t > data_edges)
char * pgr_msg(const std::string &msg)
size_t count_tuples(const std::deque< Path > &paths)
T * pgr_alloc(std::size_t size, T *ptr)
allocates memory
virtual const char * what() const