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 39d14fc commit 637ba68
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/multiLabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Rcpp::List multiLabel(Rcpp::NumericMatrix &vpts,
int vy = vpts(i,1);
const double vz = vpts(i,2) + vpth;

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

int steps;
Rcpp::IntegerMatrix visible(sub_rows, sub_cols);
Expand All @@ -43,13 +43,13 @@ Rcpp::List multiLabel(Rcpp::NumericMatrix &vpts,
std::iota(sequence.begin(), sequence.end(), 1);
Rcpp::NumericVector xl = vx + sequence * (k-vx)/steps;
Rcpp::NumericVector yl = vy + sequence * (j-vy)/steps;

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

0 comments on commit 637ba68

Please sign in to comment.