diff --git a/cpp/examples/forward_backward/inpainting.cc b/cpp/examples/forward_backward/inpainting.cc index 0ec0b9b32..65e7ff431 100644 --- a/cpp/examples/forward_backward/inpainting.cc +++ b/cpp/examples/forward_backward/inpainting.cc @@ -80,7 +80,7 @@ int main(int argc, char const **argv) { SOPT_HIGH_LOG("Create dirty vector"); std::normal_distribution<> gaussian_dist(0, sigma); Vector y(y0.size()); - for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne); + for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne); // Write dirty imagte to file if (output != "none") { Vector const dirty = sampling.adjoint() * y; diff --git a/cpp/examples/forward_backward/inpainting_credible_interval.cc b/cpp/examples/forward_backward/inpainting_credible_interval.cc index 9853eeb40..72fc2a18d 100644 --- a/cpp/examples/forward_backward/inpainting_credible_interval.cc +++ b/cpp/examples/forward_backward/inpainting_credible_interval.cc @@ -82,7 +82,7 @@ int main(int argc, char const **argv) { SOPT_HIGH_LOG("Create dirty vector"); std::normal_distribution<> gaussian_dist(0, sigma); Vector y(y0.size()); - for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne); + for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne); // Write dirty imagte to file if (output != "none") { Vector const dirty = sampling.adjoint() * y; diff --git a/cpp/examples/forward_backward/inpainting_joint_map.cc b/cpp/examples/forward_backward/inpainting_joint_map.cc index 38d6c7bf1..98d97f99a 100644 --- a/cpp/examples/forward_backward/inpainting_joint_map.cc +++ b/cpp/examples/forward_backward/inpainting_joint_map.cc @@ -81,7 +81,7 @@ int main(int argc, char const **argv) { SOPT_HIGH_LOG("Create dirty vector"); std::normal_distribution<> gaussian_dist(0, sigma); Vector y(y0.size()); - for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne); + for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne); // Write dirty imagte to file if (output != "none") { Vector const dirty = sampling.adjoint() * y; diff --git a/cpp/examples/forward_backward/l2_inpainting.cc b/cpp/examples/forward_backward/l2_inpainting.cc index 851b991a9..1f96ae961 100644 --- a/cpp/examples/forward_backward/l2_inpainting.cc +++ b/cpp/examples/forward_backward/l2_inpainting.cc @@ -78,7 +78,7 @@ int main(int argc, char const **argv) { SOPT_HIGH_LOG("Create dirty vector"); std::normal_distribution<> gaussian_dist(0, sigma); Vector y(y0.size()); - for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne); + for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne); // Write dirty imagte to file if (output != "none") { Vector const dirty = sampling.adjoint() * y; diff --git a/cpp/examples/primal_dual/inpainting.cc b/cpp/examples/primal_dual/inpainting.cc index 16f063f58..8674efbad 100644 --- a/cpp/examples/primal_dual/inpainting.cc +++ b/cpp/examples/primal_dual/inpainting.cc @@ -89,7 +89,7 @@ int main(int argc, char const **argv) { SOPT_HIGH_LOG("Create dirty vector"); std::normal_distribution<> gaussian_dist(0, sigma); Vector y(y0.size()); - for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne); + for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne); // Write dirty image to file if (output != "none") { Vector const dirty = sampling.adjoint() * y; diff --git a/cpp/examples/primal_dual/tv_inpainting.cc b/cpp/examples/primal_dual/tv_inpainting.cc index f1de70220..92342a155 100644 --- a/cpp/examples/primal_dual/tv_inpainting.cc +++ b/cpp/examples/primal_dual/tv_inpainting.cc @@ -82,7 +82,7 @@ int main(int argc, char const **argv) { SOPT_HIGH_LOG("Create dirty vector"); std::normal_distribution<> gaussian_dist(0, sigma); Vector y(y0.size()); - for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne); + for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne); // Write dirty image to file if (output != "none") { Vector const dirty = sampling.adjoint() * y; diff --git a/cpp/examples/proximal_admm/inpainting.cc b/cpp/examples/proximal_admm/inpainting.cc index cd6a5807a..57de1f9ea 100644 --- a/cpp/examples/proximal_admm/inpainting.cc +++ b/cpp/examples/proximal_admm/inpainting.cc @@ -75,7 +75,7 @@ int main(int argc, char const **argv) { SOPT_HIGH_LOG("Create dirty vector"); std::normal_distribution<> gaussian_dist(0, sigma); Vector y(y0.size()); - for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne); + for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne); // Write dirty imagte to file if (output != "none") { Vector const dirty = sampling.adjoint() * y; diff --git a/cpp/examples/proximal_admm/reweighted.cc b/cpp/examples/proximal_admm/reweighted.cc index 8a6ca7d3a..d692168fc 100644 --- a/cpp/examples/proximal_admm/reweighted.cc +++ b/cpp/examples/proximal_admm/reweighted.cc @@ -79,7 +79,7 @@ int main(int argc, char const **argv) { SOPT_MEDIUM_LOG("Create dirty vector"); std::normal_distribution<> gaussian_dist(0, sigma); Vector y(y0.size()); - for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne); + for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne); // Write dirty imagte to file if (output != "none") { Vector const dirty = sampling.adjoint() * y; diff --git a/cpp/examples/sdmm/inpainting.cc b/cpp/examples/sdmm/inpainting.cc index d08a76e0a..9497d1de9 100644 --- a/cpp/examples/sdmm/inpainting.cc +++ b/cpp/examples/sdmm/inpainting.cc @@ -74,7 +74,7 @@ int main(int argc, char const **argv) { SOPT_HIGH_LOG("Create dirty vector"); std::normal_distribution<> gaussian_dist(0, sigma); Vector y(y0.size()); - for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne); + for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne); // Write dirty imagte to file if (output != "none") { Vector const dirty = sampling.adjoint() * y; diff --git a/cpp/examples/sdmm/reweighted.cc b/cpp/examples/sdmm/reweighted.cc index 52649e93a..5274459ef 100644 --- a/cpp/examples/sdmm/reweighted.cc +++ b/cpp/examples/sdmm/reweighted.cc @@ -78,7 +78,7 @@ int main(int argc, char const **argv) { SOPT_HIGH_LOG("Create dirty vector"); std::normal_distribution<> gaussian_dist(0, sigma); Vector y(y0.size()); - for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne); + for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne); // Write dirty imagte to file if (output != "none") { Vector const dirty = sampling.adjoint() * y; diff --git a/cpp/sopt/chained_operators.h b/cpp/sopt/chained_operators.h index 3c4694ffd..479f07e6a 100644 --- a/cpp/sopt/chained_operators.h +++ b/cpp/sopt/chained_operators.h @@ -23,12 +23,12 @@ OperatorFunction chained_operators(OperatorFunction const &arg0, T const (*first)(output, input); else { (*first)(*buffer, input); - first++; + ++first; (*first)(output, *buffer); } - for (++first; first != last; first++) { + for (++first; first != last; ++first) { (*first)(*buffer, output); - first++; + ++first; (*first)(output, *buffer); } }; diff --git a/cpp/sopt/cppflow_utils.cc b/cpp/sopt/cppflow_utils.cc index 5c43bf4cb..078606630 100644 --- a/cpp/sopt/cppflow_utils.cc +++ b/cpp/sopt/cppflow_utils.cc @@ -69,7 +69,7 @@ namespace sopt::cppflowutils { cppflow::tensor convert_image_to_tensor(sopt::Vector> const &image, int image_rows, int image_cols) { std::vector input_values(image_rows); - for(int i = 0; i < image_rows; i++) + for(int i = 0; i < image_rows; ++i) { if(std::abs(image(i).real()) > cppflowutils::imaginary_threshold) { diff --git a/cpp/sopt/credible_region.h b/cpp/sopt/credible_region.h index 909399898..bd066e447 100644 --- a/cpp/sopt/credible_region.h +++ b/cpp/sopt/credible_region.h @@ -142,8 +142,8 @@ credible_interval_grid(const Eigen::MatrixBase &solution, const t_uint &rows, Image credible_grid_upper_bound = Image::Zero(grid_rows, grid_cols); Image credible_grid_mean = Image::Zero(grid_rows, grid_cols); SOPT_LOW_LOG("Starting calculation of credible interval: {} x {} grid.", grid_rows, grid_cols); - for (t_uint i = 0; i < grid_rows; i++) { - for (t_uint j = 0; j < grid_cols; j++) { + for (t_uint i = 0; i < grid_rows; ++i) { + for (t_uint j = 0; j < grid_cols; ++j) { const t_uint start_row = i * drow; const t_uint start_col = j * dcol; if (static_cast(rows - start_row - drow) < 0) diff --git a/cpp/sopt/gradient_operator.h b/cpp/sopt/gradient_operator.h index 4ab06f2d2..6728c2558 100644 --- a/cpp/sopt/gradient_operator.h +++ b/cpp/sopt/gradient_operator.h @@ -27,9 +27,9 @@ template Vector diff2d(const Vector &x, const t_int rows, const t_int cols) { Matrix output = Matrix::Zero(rows, 2 * cols); const Matrix &input_image = Matrix::Map(x.data(), rows, cols); - for (Eigen::Index i(0); i < rows; i++) + for (Eigen::Index i(0); i < rows; ++i) output.block(0, 0, rows, cols).row(i) = diff(input_image.row(i)); - for (Eigen::Index i(0); i < cols; i++) + for (Eigen::Index i(0); i < cols; ++i) output.block(0, cols, rows, cols).col(i) = diff(input_image.col(i)); return Vector::Map(output.data(), output.size()); } @@ -38,9 +38,9 @@ template Vector diff2d_adjoint(const Vector &x, const t_int rows, const t_int cols) { const Matrix &input_image = Matrix::Map(x.data(), rows, 2 * cols); Matrix output = Matrix::Zero(rows, cols); - for (Eigen::Index i(0); i < rows; i++) + for (Eigen::Index i(0); i < rows; ++i) output.row(i) += diff_adjoint(input_image.block(0, 0, rows, cols).row(i)); - for (Eigen::Index i(0); i < cols; i++) + for (Eigen::Index i(0); i < cols; ++i) output.col(i) += diff_adjoint(input_image.block(0, cols, rows, cols).col(i)); return Vector::Map(output.data(), output.size()); } diff --git a/cpp/sopt/imaging_primal_dual.h b/cpp/sopt/imaging_primal_dual.h index 9c7f93f2c..981aa4649 100644 --- a/cpp/sopt/imaging_primal_dual.h +++ b/cpp/sopt/imaging_primal_dual.h @@ -317,7 +317,7 @@ typename ImagingPrimalDual::Diagnostic ImagingPrimalDual::operat auto const g_proximal = [this](t_Vector &out, Real gamma, t_Vector const &x) { this->l2ball_proximal()(out, gamma, x); // applying preconditioning - for (t_int i = 0; i < this->precondition_iters(); i++) + for (t_int i = 0; i < this->precondition_iters(); ++i) this->l2ball_proximal()( out, gamma, out - this->precondition_stepsize() * diff --git a/cpp/sopt/joint_map.h b/cpp/sopt/joint_map.h index 8b2853739..c2371c3ce 100644 --- a/cpp/sopt/joint_map.h +++ b/cpp/sopt/joint_map.h @@ -103,7 +103,7 @@ class JointMAP { typedef typename ALGORITHM::DiagnosticAndResult ResultType; ResultType result = (*(this->algo_ptr_))(std::forward(args)...); t_real gamma = 0; - niters++; + ++niters; t_uint algo_iters(result.niters); for (; (not converged) && (niters < itermax()); ++niters) { SOPT_LOW_LOG(" - [JMAP] Iteration {}/{}", niters, itermax()); diff --git a/cpp/sopt/l2_primal_dual.h b/cpp/sopt/l2_primal_dual.h index 195c331a1..8fe70514a 100644 --- a/cpp/sopt/l2_primal_dual.h +++ b/cpp/sopt/l2_primal_dual.h @@ -316,7 +316,7 @@ typename ImagingPrimalDual::Diagnostic ImagingPrimalDual::operat auto const g_proximal = [this](t_Vector &out, Real gamma, t_Vector const &x) { this->l2ball_proximal()(out, gamma, x); // applying preconditioning - for (t_int i = 0; i < this->precondition_iters(); i++) + for (t_int i = 0; i < this->precondition_iters(); ++i) this->l2ball_proximal()( out, gamma, out - this->precondition_stepsize() * diff --git a/cpp/sopt/mpi/communicator.h b/cpp/sopt/mpi/communicator.h index aadef7bdc..047b230f9 100644 --- a/cpp/sopt/mpi/communicator.h +++ b/cpp/sopt/mpi/communicator.h @@ -333,7 +333,7 @@ Communicator::all_to_allv(const std::vector &vec, std::vector const &s return vec; } std::vector rec_sizes(send_sizes.size(), 0); - for (t_int i = 0; i < size(); i++) { + for (t_int i = 0; i < size(); ++i) { if (i == rank()) rec_sizes = gather(send_sizes[i], i); else @@ -382,7 +382,7 @@ typename std::enable_if::value, Vector>::type Communica return vec; } std::vector rec_sizes(send_sizes.size(), 0); - for (t_int i = 0; i < size(); i++) { + for (t_int i = 0; i < size(); ++i) { if (i == rank()) rec_sizes = gather(send_sizes[i], i); else diff --git a/cpp/sopt/proximal.h b/cpp/sopt/proximal.h index d6312534c..c7839846d 100644 --- a/cpp/sopt/proximal.h +++ b/cpp/sopt/proximal.h @@ -100,7 +100,7 @@ void tv_norm(Eigen::DenseBase &out, typename real_type: typename T1::PlainObject const &u = x.segment(0, size); typename T1::PlainObject const &v = x.segment(size, size); out = T0::Zero(size * 2); - for (typename Eigen::Index i(0); i < size; i++) { + for (typename Eigen::Index i(0); i < size; ++i) { const t_real norm = std::sqrt(std::abs(u(i) * u(i) + v(i) * v(i))); if (norm > gamma) { out(i) = (1 - gamma / norm) * u(i); @@ -118,7 +118,7 @@ void tv_norm(Eigen::DenseBase &out, Eigen::DenseBase const &gamma, typename T1::PlainObject const &u = x.segment(0, size); typename T1::PlainObject const &v = x.segment(size, size); out = T0::Zero(size * 2); - for (typename Eigen::Index i(0); i < size; i++) { + for (typename Eigen::Index i(0); i < size; ++i) { const t_real norm = std::sqrt(std::abs(u(i) * u(i) + v(i) * v(i))); if (norm > gamma(i)) { out(i) = (1 - gamma(i) / norm) * u(i); diff --git a/cpp/sopt/sdmm.h b/cpp/sopt/sdmm.h index 5ed24f149..a4fb90199 100644 --- a/cpp/sopt/sdmm.h +++ b/cpp/sopt/sdmm.h @@ -274,7 +274,7 @@ void SDMM::update_directions(t_Vectors &y, t_Vectors &z, t_Vector const template void SDMM::initialization(t_Vectors &y, t_Vectors &z, t_Vector const &x) const { SOPT_TRACE("Initializing SDMM"); - for (t_uint i(0); i < transforms().size(); i++) { + for (t_uint i(0); i < transforms().size(); ++i) { y[i] = transforms(i) * x; z[i].resize(y[i].size()); z[i].fill(0); diff --git a/cpp/sopt/tf_g_proximal.h b/cpp/sopt/tf_g_proximal.h index 631d66b98..c2e3185cc 100644 --- a/cpp/sopt/tf_g_proximal.h +++ b/cpp/sopt/tf_g_proximal.h @@ -104,8 +104,7 @@ class TFGProximal : public GProximal { // Added template keyword to suppress error on apple-clang, for reference // https://stackoverflow.com/questions/3786360/confusing-template-error auto output_vector = model_output[0].template get_data(); - - for(int i = 0; i < image_size; i++) { + for(int i = 0; i < image_size; ++i) { image_out[i] = static_cast(output_vector[i]); } } diff --git a/cpp/sopt/tv_primal_dual.h b/cpp/sopt/tv_primal_dual.h index c3360126e..1ae48422a 100644 --- a/cpp/sopt/tv_primal_dual.h +++ b/cpp/sopt/tv_primal_dual.h @@ -315,7 +315,7 @@ typename TVPrimalDual::Diagnostic TVPrimalDual::operator()( auto const g_proximal = [this](t_Vector &out, Real gamma, t_Vector const &x) { this->l2ball_proximal()(out, gamma, x); // applying preconditioning - for (t_int i = 0; i < this->precondition_iters(); i++) + for (t_int i = 0; i < this->precondition_iters(); ++i) this->l2ball_proximal()( out, gamma, out - this->precondition_stepsize() * diff --git a/cpp/sopt/wavelets/innards.impl.h b/cpp/sopt/wavelets/innards.impl.h index 81a29fa34..12fd47473 100644 --- a/cpp/sopt/wavelets/innards.impl.h +++ b/cpp/sopt/wavelets/innards.impl.h @@ -127,7 +127,7 @@ void up_convolve_sum(Eigen::ArrayBase &result, Eigen::ArrayBase const &c #ifdef SOPT_OPENMP #pragma omp parallel for #endif - for (typename T0::Index i = 0; i < result.size() / 2; i++) { + for (typename T0::Index i = 0; i < result.size() / 2; ++i) { result(2 * i + index_place_even) = periodic_scalar_product(coeffs.head(Nlow), low_even, i + even_offset) + periodic_scalar_product(coeffs.tail(Nhigh), high_even, i + even_offset); diff --git a/cpp/tests/communicator.cc b/cpp/tests/communicator.cc index 6908204f9..dc2cff44c 100644 --- a/cpp/tests/communicator.cc +++ b/cpp/tests/communicator.cc @@ -60,7 +60,7 @@ TEST_CASE("Creates an mpi communicator") { auto const result = world.scatter_one(scattered); REQUIRE(result == world.rank() + 2); auto const gathered = world.gather(result); - for (decltype(gathered)::size_type i = 0; i < gathered.size(); i++) + for (decltype(gathered)::size_type i = 0; i < gathered.size(); ++i) CHECK(gathered[i] == scattered[i]); } else { auto const result = world.scatter_one(); @@ -160,7 +160,7 @@ TEST_CASE("Creates an mpi communicator") { Vector::Constant(std::accumulate(sizes.begin(), sizes.end(), 0), world.rank()); const Vector output = world.all_to_allv(sendee, sizes); t_int sum = 0; - for (t_int i = 0; i < world.size() - 1; i++) { + for (t_int i = 0; i < world.size() - 1; ++i) { const Vector expected = Vector::Constant(i + 1, i + 1); CAPTURE(sum); CAPTURE(i); diff --git a/cpp/tests/credible_region.cc b/cpp/tests/credible_region.cc index bc99cf3f6..de02d86b2 100644 --- a/cpp/tests/credible_region.cc +++ b/cpp/tests/credible_region.cc @@ -19,7 +19,7 @@ TEST_CASE("calculating gamma") { }; const t_Vector x = t_Vector::Random(N); CHECK(0 == energy_function(x)); - for (t_uint i = 1; i < 10; i++) { + for (t_uint i = 1; i < 10; ++i) { const t_real alpha = 0.9 + i * 0.01; const t_real gamma = credible_region::compute_energy_upper_bound(alpha, x, energy_function); CHECK(gamma == Approx(N * (std::sqrt(16 * std::log(3 / (1 - alpha)) / N) + 1))); diff --git a/cpp/tests/gradient_operator.cc b/cpp/tests/gradient_operator.cc index c3eee11bf..7b4f4d85a 100644 --- a/cpp/tests/gradient_operator.cc +++ b/cpp/tests/gradient_operator.cc @@ -26,7 +26,7 @@ TEST_CASE("Gradient Operator") { Image const image = sopt::notinstalled::read_standard_tiff("cameraman256"); auto const psi = sopt::gradient_operator::gradient_operator(image.rows(), image.cols()); Matrix input = Matrix::Ones(image.rows(), image.cols()); - for (Eigen::Index i(0); i < image.rows(); i++) input.row(i) *= static_cast(i); + for (Eigen::Index i(0); i < image.rows(); ++i) input.row(i) *= static_cast(i); Vector output = psi.adjoint() * Vector::Map(input.data(), input.size()); CAPTURE(output.segment(0, 5)); CAPTURE(output.segment(image.size(), 5)); @@ -35,7 +35,7 @@ TEST_CASE("Gradient Operator") { CHECK(output.segment(input.size(), input.size() - 1) .isApprox(Vector::Constant(0.5, input.size() - 1))); input = Matrix::Ones(image.rows(), image.cols()); - for (Eigen::Index i(0); i < image.cols(); i++) input.col(i) *= static_cast(i); + for (Eigen::Index i(0); i < image.cols(); ++i) input.col(i) *= static_cast(i); output = psi.adjoint() * Vector::Map(input.data(), input.size()); CAPTURE(output.segment(0, 5)); CAPTURE(output.segment(image.size(), 5)); diff --git a/cpp/tests/inpainting.cc b/cpp/tests/inpainting.cc index 1f674a0d3..6bebcf49b 100644 --- a/cpp/tests/inpainting.cc +++ b/cpp/tests/inpainting.cc @@ -50,7 +50,7 @@ TEST_CASE("Inpainting"){ std::normal_distribution<> gaussian_dist(0, sigma); Vector y(y0.size()); - for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(*mersenne); + for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(*mersenne); sopt::t_real const gamma = 18; sopt::t_real const beta = sigma * sigma * 0.5; diff --git a/cpp/tests/serial_vs_parallel_padmm.cc b/cpp/tests/serial_vs_parallel_padmm.cc index 31cd71c2f..9fee10a52 100644 --- a/cpp/tests/serial_vs_parallel_padmm.cc +++ b/cpp/tests/serial_vs_parallel_padmm.cc @@ -69,7 +69,7 @@ TEST_CASE("Parallel vs serial inpainting") { std::normal_distribution<> gaussian_dist(0, sigma); Vector y = world.is_root() ? y0 : world.broadcast(); if (world.is_root()) { - for (sopt::t_int i = 0; i < y0.size(); i++) y(i) += gaussian_dist(*mersenne); + for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) += gaussian_dist(*mersenne); world.broadcast(y); } if (split_comm.size() > 1) { diff --git a/cpp/tests/tf_inpainting.cc b/cpp/tests/tf_inpainting.cc index e0d47f180..d997da491 100644 --- a/cpp/tests/tf_inpainting.cc +++ b/cpp/tests/tf_inpainting.cc @@ -46,7 +46,7 @@ TEST_CASE("Inpainting"){ std::normal_distribution<> gaussian_dist(0, sigma); Vector y(y0.size()); - for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(*mersenne); + for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(*mersenne); sopt::t_real const gamma = 18; sopt::t_real const beta = sigma * sigma * 0.5; diff --git a/cpp/tests/wavelets.cc b/cpp/tests/wavelets.cc index 84af0d031..e0344a0ca 100644 --- a/cpp/tests/wavelets.cc +++ b/cpp/tests/wavelets.cc @@ -60,7 +60,7 @@ void check_round_trip(Eigen::ArrayBase const &input_, sopt::t_uint db, } TEST_CASE("wavelet data") { - for (sopt::t_int num = 1; num < 100; num++) { + for (sopt::t_int num = 1; num < 100; ++num) { if (num < 39) REQUIRE(sopt::wavelets::daubechies_data(num).coefficients.size() == 2 * num); else diff --git a/cpp/tools_for_tests/inpainting.h b/cpp/tools_for_tests/inpainting.h index 37114b386..7f29b408e 100644 --- a/cpp/tools_for_tests/inpainting.h +++ b/cpp/tools_for_tests/inpainting.h @@ -29,7 +29,7 @@ Vector dirty(sopt::LinearTransform> const &sampling, sopt::Image auto const y0 = target(sampling, image); std::normal_distribution<> gaussian_dist(0, sigma(sampling, image)); Vector y(y0.size()); - for (t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne); + for (t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne); return y; }