Skip to content

Commit ff380e9

Browse files
committed
add verbose flag to APRDenoise class, fix signedness warnings
1 parent 45f9bbe commit ff380e9

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

src/numerics/APRDenoise.hpp

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ class APRDenoise {
392392

393393
public:
394394

395-
APRTimer timer;
395+
bool verbose = true;
396396

397397
int max_level = 4;
398398
int others_level = 1;
@@ -428,11 +428,7 @@ class APRDenoise {
428428
// Trains a level dependent de-noising model
429429
//
430430

431-
bool verbose = true;
432-
433431
auto it = apr.iterator();
434-
435-
436432
int viable_levels = 0;
437433

438434
for(int level = it.level_max(); level >= it.level_min(); level--){
@@ -453,7 +449,6 @@ class APRDenoise {
453449

454450
if(total_parts >= pts){
455451
viable_levels++;
456-
457452
}
458453

459454
}
@@ -470,7 +465,7 @@ class APRDenoise {
470465

471466
float tol_ = this->tolerance;
472467

473-
APRTimer timer(true);
468+
APRTimer timer(this->verbose);
474469

475470
timer.start_timer("train");
476471

@@ -545,7 +540,7 @@ class APRDenoise {
545540
template<typename R,typename S>
546541
void apply_denoise(APR &apr, ParticleData <R> &parts_in, ParticleData <S> &parts_out, APRStencils &aprStencils) {
547542

548-
APRTimer timer(true);
543+
APRTimer timer(this->verbose);
549544

550545
int stencil_level = aprStencils.number_levels;
551546

@@ -573,10 +568,9 @@ class APRDenoise {
573568
float
574569
apply_conv_guided(APR &apr, ParticleData <T> &parts_in,ParticleData <R> &parts_out, StencilSetUp &stencilSetUp, Stencil<S> &stencil, int level) {
575570

576-
timer.verbose_flag = true;
571+
APRTimer timer(this->verbose);
577572

578573
PixelData<T> img; //change to be level dependent
579-
// apr.interp_img(img,parts);
580574

581575
if(parts_out.size() != parts_in.size()) {
582576
parts_out.init(apr);
@@ -616,12 +610,12 @@ class APRDenoise {
616610

617611
auto it = apr.iterator();
618612

619-
uint64_t z = 0;
613+
int z = 0;
620614
#ifdef HAVE_OPENMP
621615
#pragma omp parallel for schedule(dynamic) private(z) firstprivate(local_vec, it)
622616
#endif
623617
for (z = 0; z < img.z_num; ++z) {
624-
for (uint64_t x = 0; x < img.x_num; ++x) {
618+
for (int x = 0; x < img.x_num; ++x) {
625619

626620
float temp_val = 0;
627621

@@ -680,7 +674,7 @@ class APRDenoise {
680674
template<typename T, typename S>
681675
float apply_nl_conv(PixelData<T> &img, StencilSetUp &stencilSetUp, Stencil<S> &stencil) {
682676

683-
timer.verbose_flag = true;
677+
APRTimer timer(this->verbose);
684678

685679
PixelData<T> pad_img;
686680

@@ -707,12 +701,12 @@ class APRDenoise {
707701

708702
timer.start_timer("conv");
709703

710-
uint64_t z = 0;
704+
int z = 0;
711705
#ifdef HAVE_OPENMP
712706
#pragma omp parallel for schedule(static) private(z) firstprivate(local_vec, nl_local_vec)
713707
#endif
714708
for (z = 0; z < img.z_num; ++z) {
715-
for (uint64_t x = 0; x < img.x_num; ++x) {
709+
for (int x = 0; x < img.x_num; ++x) {
716710

717711
const uint64_t img_off = x * img.y_num + z * (img.y_num * img.z_num);
718712

@@ -763,8 +757,7 @@ class APRDenoise {
763757
Stencil<S> &stencil, uint64_t N, int num_rep, int level, float factor = 0.05,
764758
bool verbose = false) {
765759

766-
timer.verbose_flag = verbose;
767-
timer.verbose_flag = true;
760+
APRTimer timer(this->verbose);
768761

769762
PixelData<T> img; //change to be level dependent
770763
// apr.interp_img(img,parts);

0 commit comments

Comments
 (0)