Skip to content

Commit

Permalink
change
Browse files Browse the repository at this point in the history
  • Loading branch information
billbillbilly committed Oct 30, 2023
1 parent 9c508fd commit 86d581a
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/multiLabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ Rcpp::List multiLabel(Rcpp::NumericMatrix &vpts,
int vy = vpts(i,1);
const double vz = vpts(i,2) + vpth;

Rcpp::NumericVector zl;
Rcpp::NumericVector xl;
Rcpp::NumericVector yl;

const int sub_rows = sub_dsm.nrow();
const int sub_cols = sub_dsm.ncol();

Expand All @@ -45,15 +41,15 @@ Rcpp::List multiLabel(Rcpp::NumericMatrix &vpts,
if (steps <= max_dis) {
Rcpp::NumericVector sequence(steps);
std::iota(sequence.begin(), sequence.end(), 1);
xl = vx + sequence * (k-vx)/steps;
yl = vy + sequence * (j-vy)/steps;
Rcpp::NumericVector xl = vx + sequence * (k-vx)/steps;
Rcpp::NumericVector yl = vy + sequence * (j-vy)/steps;

if(vz<z) {
zl = vz + sequence/steps*fabs(vz-z);
Rcpp::NumericVector zl = vz + sequence/steps*fabs(vz-z);
} else if (vz>z) {
zl = vz - sequence/steps*fabs(vz-z);
Rcpp::NumericVector zl = vz - sequence/steps*fabs(vz-z);
} else if (vz==z) {
zl = vz + 0*sequence;
Rcpp::NumericVector zl = vz + 0*sequence;
}
int temp = 1;
for (int p = 0; p < steps; p++) {
Expand Down

0 comments on commit 86d581a

Please sign in to comment.