Skip to content

Commit

Permalink
update concaveman.h/cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Jul 4, 2024
1 parent c66e5af commit be1241c
Show file tree
Hide file tree
Showing 5 changed files with 162 additions and 34 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: mapscanner
Title: Print Maps, Draw on Them, Scan Them Back in
Version: 0.1.0.001
Version: 0.1.0.002
Authors@R: c(
person("Mark", "Padgham", , "mark.padgham@email.com", role = c("aut", "cre")),
person("Michael D.", "Sumner", , "mdsumner@gmail.com", 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/ropensci/mapscanner",
"issueTracker": "https://github.com/ropensci/mapscanner/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.1.0.001",
"version": "0.1.0.002",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down
4 changes: 2 additions & 2 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ BEGIN_RCPP
END_RCPP
}
// rcpp_concaveman
Rcpp::DataFrame rcpp_concaveman(Rcpp::DataFrame xy, Rcpp::IntegerVector hull_in, const double concavity, const double length_threshold);
Rcpp::DataFrame rcpp_concaveman(Rcpp::DataFrame xy, Rcpp::NumericVector hull_in, const double concavity, const double length_threshold);
RcppExport SEXP _mapscanner_rcpp_concaveman(SEXP xySEXP, SEXP hull_inSEXP, SEXP concavitySEXP, SEXP length_thresholdSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< Rcpp::DataFrame >::type xy(xySEXP);
Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type hull_in(hull_inSEXP);
Rcpp::traits::input_parameter< Rcpp::NumericVector >::type hull_in(hull_inSEXP);
Rcpp::traits::input_parameter< const double >::type concavity(concavitySEXP);
Rcpp::traits::input_parameter< const double >::type length_threshold(length_thresholdSEXP);
rcpp_result_gen = Rcpp::wrap(rcpp_concaveman(xy, hull_in, concavity, length_threshold));
Expand Down
5 changes: 2 additions & 3 deletions src/concaveman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//' rcpp_concaveman
//' @noRd
// [[Rcpp::export]]
Rcpp::DataFrame rcpp_concaveman (Rcpp::DataFrame xy, Rcpp::IntegerVector hull_in,
Rcpp::DataFrame rcpp_concaveman (Rcpp::DataFrame xy, Rcpp::NumericVector hull_in,
const double concavity, const double length_threshold)
{
std::vector <double> x = xy ["x"], y = xy ["y"];
Expand All @@ -22,7 +22,7 @@ Rcpp::DataFrame rcpp_concaveman (Rcpp::DataFrame xy, Rcpp::IntegerVector hull_in
auto concave_points = concaveman <T, 16> (points, hull,
concavity, length_threshold);

Rcpp::IntegerVector xout (concave_points.size ()),
Rcpp::NumericVector xout (concave_points.size ()),
yout (concave_points.size ());
for (int i = 0; i < concave_points.size (); i++)
{
Expand All @@ -36,4 +36,3 @@ Rcpp::DataFrame rcpp_concaveman (Rcpp::DataFrame xy, Rcpp::IntegerVector hull_in

return res;
}

Loading

0 comments on commit be1241c

Please sign in to comment.