Skip to content

Commit

Permalink
change rcpp_points_to_edges IntVec -> NumericVec for #103
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Sep 2, 2022
1 parent 1a30d67 commit 1b5f16f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: dodgr
Title: Distances on Directed Graphs
Version: 0.2.15.006
Version: 0.2.15.007
Authors@R: c(
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre")),
person("Andreas", "Petutschnig", role = "aut"),
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"codeRepository": "https://github.com/ATFutures/dodgr",
"issueTracker": "https://github.com/ATFutures/dodgr/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.2.15.006",
"version": "0.2.15.007",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down
2 changes: 1 addition & 1 deletion src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ BEGIN_RCPP
END_RCPP
}
// rcpp_points_to_edges_par
Rcpp::IntegerVector rcpp_points_to_edges_par(const Rcpp::DataFrame& graph, Rcpp::DataFrame& pts);
Rcpp::NumericVector rcpp_points_to_edges_par(const Rcpp::DataFrame& graph, Rcpp::DataFrame& pts);
RcppExport SEXP _dodgr_rcpp_points_to_edges_par(SEXP graphSEXP, SEXP ptsSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Expand Down
10 changes: 5 additions & 5 deletions src/match-points.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct OneEdgeIndex : public RcppParallel::Worker
const RcppParallel::RVector <double> pt_x, pt_y,
xfr, yfr, xto, yto;
const size_t nxy;
RcppParallel::RVector <int> index;
RcppParallel::RVector <double> index;

// constructor
OneEdgeIndex (
Expand All @@ -79,7 +79,7 @@ struct OneEdgeIndex : public RcppParallel::Worker
const RcppParallel::RVector <double> xto_in,
const RcppParallel::RVector <double> yto_in,
const size_t nxy_in,
Rcpp::IntegerVector index_in) :
Rcpp::NumericVector index_in) :
pt_x (pt_x_in), pt_y (pt_y_in),
xfr (xfr_in), yfr (yfr_in), xto (xto_in), yto (yto_in),
nxy (nxy_in), index (index_in)
Expand Down Expand Up @@ -138,7 +138,7 @@ struct OneEdgeIndex : public RcppParallel::Worker
jmin = static_cast <long int> (j);
}
}
index [i] = static_cast <int> (jmin);
index [i] = static_cast <double> (jmin);
}
}

Expand Down Expand Up @@ -191,7 +191,7 @@ Rcpp::IntegerVector rcpp_points_index_par (const Rcpp::DataFrame &xy,
//'
//' @noRd
// [[Rcpp::export]]
Rcpp::IntegerVector rcpp_points_to_edges_par (const Rcpp::DataFrame &graph,
Rcpp::NumericVector rcpp_points_to_edges_par (const Rcpp::DataFrame &graph,
Rcpp::DataFrame &pts)
{
Rcpp::NumericVector ptx = pts ["x"];
Expand All @@ -205,7 +205,7 @@ Rcpp::IntegerVector rcpp_points_to_edges_par (const Rcpp::DataFrame &graph,
const size_t npts = static_cast <size_t> (pts.nrow ()),
nxy = static_cast <size_t> (graph.nrow ());

Rcpp::IntegerVector index (npts);
Rcpp::NumericVector index (npts);

// Create parallel worker
OneEdgeIndex one_edge_indx (RcppParallel::RVector <double> (ptx),
Expand Down
2 changes: 1 addition & 1 deletion src/match-points.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ int which_side_of_line (const double ax, const double ay,

Rcpp::IntegerVector rcpp_points_index (const Rcpp::DataFrame &xy,
Rcpp::DataFrame &pts);
Rcpp::IntegerVector rcpp_points_to_edges_par (const Rcpp::DataFrame &graph,
Rcpp::NumericVector rcpp_points_to_edges_par (const Rcpp::DataFrame &graph,
Rcpp::DataFrame &pts);

0 comments on commit 1b5f16f

Please sign in to comment.