Skip to content

Commit

Permalink
- update
Browse files Browse the repository at this point in the history
  • Loading branch information
billbillbilly committed Oct 30, 2023
1 parent 224bf36 commit 24cc3c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/multiLabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Rcpp::List multiLabel(Rcpp::NumericMatrix &vpts,
const int vptnum = vpts.rows();
Rcpp::List output(vptnum);
#ifdef _WIN32
#pragma omp parallel shared(output, dsm_list, max_dis, vpth, h, vptnum) num_threads(workers)
#pragma omp parallel shared(output, dsm_list, max_dis, vpth, h, vptnum) num_threads(workers) for
for (int i = 0; i < vptnum; i++) {
const Rcpp::NumericMatrix sub_dsm = dsm_list[i];
int vx = vpts(i,0);
Expand All @@ -35,7 +35,6 @@ Rcpp::List multiLabel(Rcpp::NumericMatrix &vpts,

int steps;
Rcpp::IntegerMatrix visible(sub_rows, sub_cols);
#pragma omp critical
for (int j = 0; j < sub_rows; j++) {
for (int k = 0; k < sub_cols; k++) {
steps = sqrt((vx-k)*(vx-k) + (vy-j)*(vy-j));
Expand Down Expand Up @@ -67,6 +66,7 @@ Rcpp::List multiLabel(Rcpp::NumericMatrix &vpts,
}
}
}
#pragma omp critical
output[i] = visible;
}
#endif
Expand Down

0 comments on commit 24cc3c6

Please sign in to comment.