many-to-many multi-modal routing aggregator
at main 211 lines 12 kB view raw
1// Generated by using Rcpp::compileAttributes() -> do not edit by hand 2// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 3 4#include <RcppThread.h> 5#include <Rcpp.h> 6 7using namespace Rcpp; 8 9#ifdef RCPP_USE_GLOBAL_ROSTREAM 10Rcpp::Rostream<true>& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); 11Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get(); 12#endif 13 14// rcpp_add_net_to_gtfs 15Rcpp::IntegerMatrix rcpp_add_net_to_gtfs(Rcpp::IntegerMatrix t_net_to_gtfs, Rcpp::IntegerMatrix gtfs_times, Rcpp::List gtfs_to_net_index, Rcpp::List gtfs_to_net_dist, const int nverts); 16RcppExport SEXP _m4ra_rcpp_add_net_to_gtfs(SEXP t_net_to_gtfsSEXP, SEXP gtfs_timesSEXP, SEXP gtfs_to_net_indexSEXP, SEXP gtfs_to_net_distSEXP, SEXP nvertsSEXP) { 17BEGIN_RCPP 18 Rcpp::RObject rcpp_result_gen; 19 Rcpp::RNGScope rcpp_rngScope_gen; 20 Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type t_net_to_gtfs(t_net_to_gtfsSEXP); 21 Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type gtfs_times(gtfs_timesSEXP); 22 Rcpp::traits::input_parameter< Rcpp::List >::type gtfs_to_net_index(gtfs_to_net_indexSEXP); 23 Rcpp::traits::input_parameter< Rcpp::List >::type gtfs_to_net_dist(gtfs_to_net_distSEXP); 24 Rcpp::traits::input_parameter< const int >::type nverts(nvertsSEXP); 25 rcpp_result_gen = Rcpp::wrap(rcpp_add_net_to_gtfs(t_net_to_gtfs, gtfs_times, gtfs_to_net_index, gtfs_to_net_dist, nverts)); 26 return rcpp_result_gen; 27END_RCPP 28} 29// rcpp_min_from_two_matrices 30Rcpp::IntegerMatrix rcpp_min_from_two_matrices(Rcpp::IntegerMatrix mat1, Rcpp::IntegerMatrix mat2); 31RcppExport SEXP _m4ra_rcpp_min_from_two_matrices(SEXP mat1SEXP, SEXP mat2SEXP) { 32BEGIN_RCPP 33 Rcpp::RObject rcpp_result_gen; 34 Rcpp::RNGScope rcpp_rngScope_gen; 35 Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type mat1(mat1SEXP); 36 Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type mat2(mat2SEXP); 37 rcpp_result_gen = Rcpp::wrap(rcpp_min_from_two_matrices(mat1, mat2)); 38 return rcpp_result_gen; 39END_RCPP 40} 41// rcpp_weighted_dists 42Rcpp::NumericMatrix rcpp_weighted_dists(const Rcpp::DataFrame graph, const Rcpp::DataFrame vert_map_in, Rcpp::IntegerVector fromi, Rcpp::IntegerVector toi_in, Rcpp::NumericVector weights, const double dlim, const double k); 43RcppExport SEXP _m4ra_rcpp_weighted_dists(SEXP graphSEXP, SEXP vert_map_inSEXP, SEXP fromiSEXP, SEXP toi_inSEXP, SEXP weightsSEXP, SEXP dlimSEXP, SEXP kSEXP) { 44BEGIN_RCPP 45 Rcpp::RObject rcpp_result_gen; 46 Rcpp::RNGScope rcpp_rngScope_gen; 47 Rcpp::traits::input_parameter< const Rcpp::DataFrame >::type graph(graphSEXP); 48 Rcpp::traits::input_parameter< const Rcpp::DataFrame >::type vert_map_in(vert_map_inSEXP); 49 Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type fromi(fromiSEXP); 50 Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type toi_in(toi_inSEXP); 51 Rcpp::traits::input_parameter< Rcpp::NumericVector >::type weights(weightsSEXP); 52 Rcpp::traits::input_parameter< const double >::type dlim(dlimSEXP); 53 Rcpp::traits::input_parameter< const double >::type k(kSEXP); 54 rcpp_result_gen = Rcpp::wrap(rcpp_weighted_dists(graph, vert_map_in, fromi, toi_in, weights, dlim, k)); 55 return rcpp_result_gen; 56END_RCPP 57} 58// rcpp_get_sp_dists_par 59Rcpp::NumericMatrix rcpp_get_sp_dists_par(const Rcpp::DataFrame graph, const Rcpp::DataFrame vert_map_in, Rcpp::IntegerVector fromi, Rcpp::IntegerVector toi_in); 60RcppExport SEXP _m4ra_rcpp_get_sp_dists_par(SEXP graphSEXP, SEXP vert_map_inSEXP, SEXP fromiSEXP, SEXP toi_inSEXP) { 61BEGIN_RCPP 62 Rcpp::RObject rcpp_result_gen; 63 Rcpp::RNGScope rcpp_rngScope_gen; 64 Rcpp::traits::input_parameter< const Rcpp::DataFrame >::type graph(graphSEXP); 65 Rcpp::traits::input_parameter< const Rcpp::DataFrame >::type vert_map_in(vert_map_inSEXP); 66 Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type fromi(fromiSEXP); 67 Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type toi_in(toi_inSEXP); 68 rcpp_result_gen = Rcpp::wrap(rcpp_get_sp_dists_par(graph, vert_map_in, fromi, toi_in)); 69 return rcpp_result_gen; 70END_RCPP 71} 72// rcpp_dists_to_n_targets 73Rcpp::NumericMatrix rcpp_dists_to_n_targets(const Rcpp::DataFrame graph, const Rcpp::DataFrame vert_map_in, Rcpp::IntegerVector fromi, Rcpp::IntegerVector toi_in, const int n_targets); 74RcppExport SEXP _m4ra_rcpp_dists_to_n_targets(SEXP graphSEXP, SEXP vert_map_inSEXP, SEXP fromiSEXP, SEXP toi_inSEXP, SEXP n_targetsSEXP) { 75BEGIN_RCPP 76 Rcpp::RObject rcpp_result_gen; 77 Rcpp::RNGScope rcpp_rngScope_gen; 78 Rcpp::traits::input_parameter< const Rcpp::DataFrame >::type graph(graphSEXP); 79 Rcpp::traits::input_parameter< const Rcpp::DataFrame >::type vert_map_in(vert_map_inSEXP); 80 Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type fromi(fromiSEXP); 81 Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type toi_in(toi_inSEXP); 82 Rcpp::traits::input_parameter< const int >::type n_targets(n_targetsSEXP); 83 rcpp_result_gen = Rcpp::wrap(rcpp_dists_to_n_targets(graph, vert_map_in, fromi, toi_in, n_targets)); 84 return rcpp_result_gen; 85END_RCPP 86} 87// rcpp_save_sp_dists_par 88bool rcpp_save_sp_dists_par(const Rcpp::DataFrame graph, const Rcpp::DataFrame vert_map_in, Rcpp::IntegerVector from_index, Rcpp::CharacterVector from_names_in, Rcpp::IntegerVector toi_in, const std::string path); 89RcppExport SEXP _m4ra_rcpp_save_sp_dists_par(SEXP graphSEXP, SEXP vert_map_inSEXP, SEXP from_indexSEXP, SEXP from_names_inSEXP, SEXP toi_inSEXP, SEXP pathSEXP) { 90BEGIN_RCPP 91 Rcpp::RObject rcpp_result_gen; 92 Rcpp::RNGScope rcpp_rngScope_gen; 93 Rcpp::traits::input_parameter< const Rcpp::DataFrame >::type graph(graphSEXP); 94 Rcpp::traits::input_parameter< const Rcpp::DataFrame >::type vert_map_in(vert_map_inSEXP); 95 Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type from_index(from_indexSEXP); 96 Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type from_names_in(from_names_inSEXP); 97 Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type toi_in(toi_inSEXP); 98 Rcpp::traits::input_parameter< const std::string >::type path(pathSEXP); 99 rcpp_result_gen = Rcpp::wrap(rcpp_save_sp_dists_par(graph, vert_map_in, from_index, from_names_in, toi_in, path)); 100 return rcpp_result_gen; 101END_RCPP 102} 103// rcpp_scan_time_files 104void rcpp_scan_time_files(const Rcpp::DataFrame tt, Rcpp::NumericVector& times, const std::string& path); 105RcppExport SEXP _m4ra_rcpp_scan_time_files(SEXP ttSEXP, SEXP timesSEXP, SEXP pathSEXP) { 106BEGIN_RCPP 107 Rcpp::RNGScope rcpp_rngScope_gen; 108 Rcpp::traits::input_parameter< const Rcpp::DataFrame >::type tt(ttSEXP); 109 Rcpp::traits::input_parameter< Rcpp::NumericVector& >::type times(timesSEXP); 110 Rcpp::traits::input_parameter< const std::string& >::type path(pathSEXP); 111 rcpp_scan_time_files(tt, times, path); 112 return R_NilValue; 113END_RCPP 114} 115// rcpp_closest_gtfs 116Rcpp::List rcpp_closest_gtfs(Rcpp::DataFrame vxy, Rcpp::DataFrame stops, const int n_closest); 117RcppExport SEXP _m4ra_rcpp_closest_gtfs(SEXP vxySEXP, SEXP stopsSEXP, SEXP n_closestSEXP) { 118BEGIN_RCPP 119 Rcpp::RObject rcpp_result_gen; 120 Rcpp::RNGScope rcpp_rngScope_gen; 121 Rcpp::traits::input_parameter< Rcpp::DataFrame >::type vxy(vxySEXP); 122 Rcpp::traits::input_parameter< Rcpp::DataFrame >::type stops(stopsSEXP); 123 Rcpp::traits::input_parameter< const int >::type n_closest(n_closestSEXP); 124 rcpp_result_gen = Rcpp::wrap(rcpp_closest_gtfs(vxy, stops, n_closest)); 125 return rcpp_result_gen; 126END_RCPP 127} 128// rcpp_closest_pts 129Rcpp::NumericMatrix rcpp_closest_pts(Rcpp::NumericMatrix dmat, const int n_closest, const double maxd); 130RcppExport SEXP _m4ra_rcpp_closest_pts(SEXP dmatSEXP, SEXP n_closestSEXP, SEXP maxdSEXP) { 131BEGIN_RCPP 132 Rcpp::RObject rcpp_result_gen; 133 Rcpp::RNGScope rcpp_rngScope_gen; 134 Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dmat(dmatSEXP); 135 Rcpp::traits::input_parameter< const int >::type n_closest(n_closestSEXP); 136 Rcpp::traits::input_parameter< const double >::type maxd(maxdSEXP); 137 rcpp_result_gen = Rcpp::wrap(rcpp_closest_pts(dmat, n_closest, maxd)); 138 return rcpp_result_gen; 139END_RCPP 140} 141// rcpp_net_gtfs_travel_times 142Rcpp::IntegerMatrix rcpp_net_gtfs_travel_times(Rcpp::IntegerMatrix t_net_to_gtfs, Rcpp::IntegerMatrix t_gtfs_to_gtfs, Rcpp::IntegerMatrix t_gtfs_to_net, Rcpp::List closest_gtfs_to_from, Rcpp::IntegerMatrix closest_gtfs_to_net); 143RcppExport SEXP _m4ra_rcpp_net_gtfs_travel_times(SEXP t_net_to_gtfsSEXP, SEXP t_gtfs_to_gtfsSEXP, SEXP t_gtfs_to_netSEXP, SEXP closest_gtfs_to_fromSEXP, SEXP closest_gtfs_to_netSEXP) { 144BEGIN_RCPP 145 Rcpp::RObject rcpp_result_gen; 146 Rcpp::RNGScope rcpp_rngScope_gen; 147 Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type t_net_to_gtfs(t_net_to_gtfsSEXP); 148 Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type t_gtfs_to_gtfs(t_gtfs_to_gtfsSEXP); 149 Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type t_gtfs_to_net(t_gtfs_to_netSEXP); 150 Rcpp::traits::input_parameter< Rcpp::List >::type closest_gtfs_to_from(closest_gtfs_to_fromSEXP); 151 Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type closest_gtfs_to_net(closest_gtfs_to_netSEXP); 152 rcpp_result_gen = Rcpp::wrap(rcpp_net_gtfs_travel_times(t_net_to_gtfs, t_gtfs_to_gtfs, t_gtfs_to_net, closest_gtfs_to_from, closest_gtfs_to_net)); 153 return rcpp_result_gen; 154END_RCPP 155} 156// rcpp_expand_closest_index 157Rcpp::List rcpp_expand_closest_index(Rcpp::NumericMatrix closest); 158RcppExport SEXP _m4ra_rcpp_expand_closest_index(SEXP closestSEXP) { 159BEGIN_RCPP 160 Rcpp::RObject rcpp_result_gen; 161 Rcpp::RNGScope rcpp_rngScope_gen; 162 Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type closest(closestSEXP); 163 rcpp_result_gen = Rcpp::wrap(rcpp_expand_closest_index(closest)); 164 return rcpp_result_gen; 165END_RCPP 166} 167// rcpp_remap_verts_to_stops 168Rcpp::List rcpp_remap_verts_to_stops(Rcpp::NumericMatrix& dmat, Rcpp::IntegerVector& index_out); 169RcppExport SEXP _m4ra_rcpp_remap_verts_to_stops(SEXP dmatSEXP, SEXP index_outSEXP) { 170BEGIN_RCPP 171 Rcpp::RObject rcpp_result_gen; 172 Rcpp::RNGScope rcpp_rngScope_gen; 173 Rcpp::traits::input_parameter< Rcpp::NumericMatrix& >::type dmat(dmatSEXP); 174 Rcpp::traits::input_parameter< Rcpp::IntegerVector& >::type index_out(index_outSEXP); 175 rcpp_result_gen = Rcpp::wrap(rcpp_remap_verts_to_stops(dmat, index_out)); 176 return rcpp_result_gen; 177END_RCPP 178} 179// rcpp_matrix_max 180const double rcpp_matrix_max(Rcpp::NumericMatrix mat); 181RcppExport SEXP _m4ra_rcpp_matrix_max(SEXP matSEXP) { 182BEGIN_RCPP 183 Rcpp::RObject rcpp_result_gen; 184 Rcpp::RNGScope rcpp_rngScope_gen; 185 Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type mat(matSEXP); 186 rcpp_result_gen = Rcpp::wrap(rcpp_matrix_max(mat)); 187 return rcpp_result_gen; 188END_RCPP 189} 190 191static const R_CallMethodDef CallEntries[] = { 192 {"_m4ra_rcpp_add_net_to_gtfs", (DL_FUNC) &_m4ra_rcpp_add_net_to_gtfs, 5}, 193 {"_m4ra_rcpp_min_from_two_matrices", (DL_FUNC) &_m4ra_rcpp_min_from_two_matrices, 2}, 194 {"_m4ra_rcpp_weighted_dists", (DL_FUNC) &_m4ra_rcpp_weighted_dists, 7}, 195 {"_m4ra_rcpp_get_sp_dists_par", (DL_FUNC) &_m4ra_rcpp_get_sp_dists_par, 4}, 196 {"_m4ra_rcpp_dists_to_n_targets", (DL_FUNC) &_m4ra_rcpp_dists_to_n_targets, 5}, 197 {"_m4ra_rcpp_save_sp_dists_par", (DL_FUNC) &_m4ra_rcpp_save_sp_dists_par, 6}, 198 {"_m4ra_rcpp_scan_time_files", (DL_FUNC) &_m4ra_rcpp_scan_time_files, 3}, 199 {"_m4ra_rcpp_closest_gtfs", (DL_FUNC) &_m4ra_rcpp_closest_gtfs, 3}, 200 {"_m4ra_rcpp_closest_pts", (DL_FUNC) &_m4ra_rcpp_closest_pts, 3}, 201 {"_m4ra_rcpp_net_gtfs_travel_times", (DL_FUNC) &_m4ra_rcpp_net_gtfs_travel_times, 5}, 202 {"_m4ra_rcpp_expand_closest_index", (DL_FUNC) &_m4ra_rcpp_expand_closest_index, 1}, 203 {"_m4ra_rcpp_remap_verts_to_stops", (DL_FUNC) &_m4ra_rcpp_remap_verts_to_stops, 2}, 204 {"_m4ra_rcpp_matrix_max", (DL_FUNC) &_m4ra_rcpp_matrix_max, 1}, 205 {NULL, NULL, 0} 206}; 207 208RcppExport void R_init_m4ra(DllInfo *dll) { 209 R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); 210 R_useDynamicSymbols(dll, FALSE); 211}