Skip to content

Commit 9486d9e

Browse files
chore: replace postfix increment and decrement operators with their prefix equivalents
1 parent 2031067 commit 9486d9e

31 files changed

+41
-41
lines changed

cpp/examples/forward_backward/inpainting.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ int main(int argc, char const **argv) {
8080
SOPT_HIGH_LOG("Create dirty vector");
8181
std::normal_distribution<> gaussian_dist(0, sigma);
8282
Vector y(y0.size());
83-
for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne);
83+
for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne);
8484
// Write dirty imagte to file
8585
if (output != "none") {
8686
Vector const dirty = sampling.adjoint() * y;

cpp/examples/forward_backward/inpainting_credible_interval.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ int main(int argc, char const **argv) {
8282
SOPT_HIGH_LOG("Create dirty vector");
8383
std::normal_distribution<> gaussian_dist(0, sigma);
8484
Vector y(y0.size());
85-
for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne);
85+
for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne);
8686
// Write dirty imagte to file
8787
if (output != "none") {
8888
Vector const dirty = sampling.adjoint() * y;

cpp/examples/forward_backward/inpainting_joint_map.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ int main(int argc, char const **argv) {
8181
SOPT_HIGH_LOG("Create dirty vector");
8282
std::normal_distribution<> gaussian_dist(0, sigma);
8383
Vector y(y0.size());
84-
for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne);
84+
for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne);
8585
// Write dirty imagte to file
8686
if (output != "none") {
8787
Vector const dirty = sampling.adjoint() * y;

cpp/examples/forward_backward/l2_inpainting.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ int main(int argc, char const **argv) {
7878
SOPT_HIGH_LOG("Create dirty vector");
7979
std::normal_distribution<> gaussian_dist(0, sigma);
8080
Vector y(y0.size());
81-
for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne);
81+
for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne);
8282
// Write dirty imagte to file
8383
if (output != "none") {
8484
Vector const dirty = sampling.adjoint() * y;

cpp/examples/primal_dual/inpainting.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ int main(int argc, char const **argv) {
8989
SOPT_HIGH_LOG("Create dirty vector");
9090
std::normal_distribution<> gaussian_dist(0, sigma);
9191
Vector y(y0.size());
92-
for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne);
92+
for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne);
9393
// Write dirty image to file
9494
if (output != "none") {
9595
Vector const dirty = sampling.adjoint() * y;

cpp/examples/primal_dual/tv_inpainting.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ int main(int argc, char const **argv) {
8282
SOPT_HIGH_LOG("Create dirty vector");
8383
std::normal_distribution<> gaussian_dist(0, sigma);
8484
Vector y(y0.size());
85-
for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne);
85+
for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne);
8686
// Write dirty image to file
8787
if (output != "none") {
8888
Vector const dirty = sampling.adjoint() * y;

cpp/examples/proximal_admm/inpainting.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ int main(int argc, char const **argv) {
7575
SOPT_HIGH_LOG("Create dirty vector");
7676
std::normal_distribution<> gaussian_dist(0, sigma);
7777
Vector y(y0.size());
78-
for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne);
78+
for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne);
7979
// Write dirty imagte to file
8080
if (output != "none") {
8181
Vector const dirty = sampling.adjoint() * y;

cpp/examples/proximal_admm/reweighted.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ int main(int argc, char const **argv) {
7979
SOPT_MEDIUM_LOG("Create dirty vector");
8080
std::normal_distribution<> gaussian_dist(0, sigma);
8181
Vector y(y0.size());
82-
for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne);
82+
for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne);
8383
// Write dirty imagte to file
8484
if (output != "none") {
8585
Vector const dirty = sampling.adjoint() * y;

cpp/examples/sdmm/inpainting.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ int main(int argc, char const **argv) {
7474
SOPT_HIGH_LOG("Create dirty vector");
7575
std::normal_distribution<> gaussian_dist(0, sigma);
7676
Vector y(y0.size());
77-
for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne);
77+
for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne);
7878
// Write dirty imagte to file
7979
if (output != "none") {
8080
Vector const dirty = sampling.adjoint() * y;

cpp/examples/sdmm/reweighted.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ int main(int argc, char const **argv) {
7878
SOPT_HIGH_LOG("Create dirty vector");
7979
std::normal_distribution<> gaussian_dist(0, sigma);
8080
Vector y(y0.size());
81-
for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne);
81+
for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne);
8282
// Write dirty imagte to file
8383
if (output != "none") {
8484
Vector const dirty = sampling.adjoint() * y;

cpp/sopt/chained_operators.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ OperatorFunction<T0> chained_operators(OperatorFunction<T0> const &arg0, T const
2323
(*first)(output, input);
2424
else {
2525
(*first)(*buffer, input);
26-
first++;
26+
++first;
2727
(*first)(output, *buffer);
2828
}
29-
for (++first; first != last; first++) {
29+
for (++first; first != last; ++first) {
3030
(*first)(*buffer, output);
31-
first++;
31+
++first;
3232
(*first)(output, *buffer);
3333
}
3434
};

cpp/sopt/cppflow_utils.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ namespace cppflowutils {
7070
cppflow::tensor convert_image_to_tensor(sopt::Vector<std::complex<double>> const &image, int image_rows, int image_cols) {
7171

7272
std::vector<float> input_values(image_rows);
73-
for(int i = 0; i < image_rows; i++)
73+
for(int i = 0; i < image_rows; ++i)
7474
{
7575
if(std::abs(image(i).real()) > cppflowutils::imaginary_threshold)
7676
{

cpp/sopt/credible_region.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ credible_interval_grid(const Eigen::MatrixBase<T> &solution, const t_uint &rows,
145145
Image<K> credible_grid_upper_bound = Image<K>::Zero(grid_rows, grid_cols);
146146
Image<K> credible_grid_mean = Image<K>::Zero(grid_rows, grid_cols);
147147
SOPT_LOW_LOG("Starting calculation of credible interval: {} x {} grid.", grid_rows, grid_cols);
148-
for (t_uint i = 0; i < grid_rows; i++) {
149-
for (t_uint j = 0; j < grid_cols; j++) {
148+
for (t_uint i = 0; i < grid_rows; ++i) {
149+
for (t_uint j = 0; j < grid_cols; ++j) {
150150
const t_uint start_row = i * drow;
151151
const t_uint start_col = j * dcol;
152152
if (static_cast<t_int>(rows - start_row - drow) < 0)

cpp/sopt/gradient_operator.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ template <class T>
2828
Vector<T> diff2d(const Vector<T> &x, const t_int rows, const t_int cols) {
2929
Matrix<T> output = Matrix<T>::Zero(rows, 2 * cols);
3030
const Matrix<T> &input_image = Matrix<T>::Map(x.data(), rows, cols);
31-
for (Eigen::Index i(0); i < rows; i++)
31+
for (Eigen::Index i(0); i < rows; ++i)
3232
output.block(0, 0, rows, cols).row(i) = diff<T>(input_image.row(i));
33-
for (Eigen::Index i(0); i < cols; i++)
33+
for (Eigen::Index i(0); i < cols; ++i)
3434
output.block(0, cols, rows, cols).col(i) = diff<T>(input_image.col(i));
3535
return Vector<T>::Map(output.data(), output.size());
3636
}
@@ -39,9 +39,9 @@ template <class T>
3939
Vector<T> diff2d_adjoint(const Vector<T> &x, const t_int rows, const t_int cols) {
4040
const Matrix<T> &input_image = Matrix<T>::Map(x.data(), rows, 2 * cols);
4141
Matrix<T> output = Matrix<T>::Zero(rows, cols);
42-
for (Eigen::Index i(0); i < rows; i++)
42+
for (Eigen::Index i(0); i < rows; ++i)
4343
output.row(i) += diff_adjoint<T>(input_image.block(0, 0, rows, cols).row(i));
44-
for (Eigen::Index i(0); i < cols; i++)
44+
for (Eigen::Index i(0); i < cols; ++i)
4545
output.col(i) += diff_adjoint<T>(input_image.block(0, cols, rows, cols).col(i));
4646
return Vector<T>::Map(output.data(), output.size());
4747
}

cpp/sopt/imaging_primal_dual.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ typename ImagingPrimalDual<SCALAR>::Diagnostic ImagingPrimalDual<SCALAR>::operat
318318
auto const g_proximal = [this](t_Vector &out, Real gamma, t_Vector const &x) {
319319
this->l2ball_proximal()(out, gamma, x);
320320
// applying preconditioning
321-
for (t_int i = 0; i < this->precondition_iters(); i++)
321+
for (t_int i = 0; i < this->precondition_iters(); ++i)
322322
this->l2ball_proximal()(
323323
out, gamma,
324324
out - this->precondition_stepsize() *

cpp/sopt/joint_map.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class JointMAP {
104104
typedef typename ALGORITHM::DiagnosticAndResult ResultType;
105105
ResultType result = (*(this->algo_ptr_))(std::forward<ARGS>(args)...);
106106
t_real gamma = 0;
107-
niters++;
107+
++niters;
108108
t_uint algo_iters(result.niters);
109109
for (; (not converged) && (niters < itermax()); ++niters) {
110110
SOPT_LOW_LOG(" - [JMAP] Iteration {}/{}", niters, itermax());

cpp/sopt/l2_primal_dual.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ typename ImagingPrimalDual<SCALAR>::Diagnostic ImagingPrimalDual<SCALAR>::operat
317317
auto const g_proximal = [this](t_Vector &out, Real gamma, t_Vector const &x) {
318318
this->l2ball_proximal()(out, gamma, x);
319319
// applying preconditioning
320-
for (t_int i = 0; i < this->precondition_iters(); i++)
320+
for (t_int i = 0; i < this->precondition_iters(); ++i)
321321
this->l2ball_proximal()(
322322
out, gamma,
323323
out - this->precondition_stepsize() *

cpp/sopt/mpi/communicator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ Communicator::all_to_allv(const std::vector<T> &vec, std::vector<t_int> const &s
334334
return vec;
335335
}
336336
std::vector<t_int> rec_sizes(send_sizes.size(), 0);
337-
for (t_int i = 0; i < size(); i++) {
337+
for (t_int i = 0; i < size(); ++i) {
338338
if (i == rank())
339339
rec_sizes = gather<t_int>(send_sizes[i], i);
340340
else
@@ -383,7 +383,7 @@ typename std::enable_if<is_registered_type<T>::value, Vector<T>>::type Communica
383383
return vec;
384384
}
385385
std::vector<t_int> rec_sizes(send_sizes.size(), 0);
386-
for (t_int i = 0; i < size(); i++) {
386+
for (t_int i = 0; i < size(); ++i) {
387387
if (i == rank())
388388
rec_sizes = gather<t_int>(send_sizes[i], i);
389389
else

cpp/sopt/proximal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void tv_norm(Eigen::DenseBase<T0> &out, typename real_type<typename T0::Scalar>:
101101
typename T1::PlainObject const &u = x.segment(0, size);
102102
typename T1::PlainObject const &v = x.segment(size, size);
103103
out = T0::Zero(size * 2);
104-
for (typename Eigen::Index i(0); i < size; i++) {
104+
for (typename Eigen::Index i(0); i < size; ++i) {
105105
const t_real norm = std::sqrt(std::abs(u(i) * u(i) + v(i) * v(i)));
106106
if (norm > gamma) {
107107
out(i) = (1 - gamma / norm) * u(i);
@@ -119,7 +119,7 @@ void tv_norm(Eigen::DenseBase<T0> &out, Eigen::DenseBase<T2> const &gamma,
119119
typename T1::PlainObject const &u = x.segment(0, size);
120120
typename T1::PlainObject const &v = x.segment(size, size);
121121
out = T0::Zero(size * 2);
122-
for (typename Eigen::Index i(0); i < size; i++) {
122+
for (typename Eigen::Index i(0); i < size; ++i) {
123123
const t_real norm = std::sqrt(std::abs(u(i) * u(i) + v(i) * v(i)));
124124
if (norm > gamma(i)) {
125125
out(i) = (1 - gamma(i) / norm) * u(i);

cpp/sopt/sdmm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ void SDMM<SCALAR>::update_directions(t_Vectors &y, t_Vectors &z, t_Vector const
275275
template <class SCALAR>
276276
void SDMM<SCALAR>::initialization(t_Vectors &y, t_Vectors &z, t_Vector const &x) const {
277277
SOPT_TRACE("Initializing SDMM");
278-
for (t_uint i(0); i < transforms().size(); i++) {
278+
for (t_uint i(0); i < transforms().size(); ++i) {
279279
y[i] = transforms(i) * x;
280280
z[i].resize(y[i].size());
281281
z[i].fill(0);

cpp/sopt/tf_g_proximal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class TFGProximal : public GProximal<SCALAR> {
106106
// https://stackoverflow.com/questions/3786360/confusing-template-error
107107
auto output_vector = model_output[0].template get_data<float>();
108108

109-
for(int i = 0; i < image_size; i++) {
109+
for(int i = 0; i < image_size; ++i) {
110110
image_out[i] = static_cast<Scalar>(output_vector[i]);
111111
}
112112
}

cpp/sopt/tv_primal_dual.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ typename TVPrimalDual<SCALAR>::Diagnostic TVPrimalDual<SCALAR>::operator()(
316316
auto const g_proximal = [this](t_Vector &out, Real gamma, t_Vector const &x) {
317317
this->l2ball_proximal()(out, gamma, x);
318318
// applying preconditioning
319-
for (t_int i = 0; i < this->precondition_iters(); i++)
319+
for (t_int i = 0; i < this->precondition_iters(); ++i)
320320
this->l2ball_proximal()(
321321
out, gamma,
322322
out - this->precondition_stepsize() *

cpp/sopt/wavelets/innards.impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void up_convolve_sum(Eigen::ArrayBase<T0> &result, Eigen::ArrayBase<T1> const &c
128128
#ifdef SOPT_OPENMP
129129
#pragma omp parallel for
130130
#endif
131-
for (typename T0::Index i = 0; i < result.size() / 2; i++) {
131+
for (typename T0::Index i = 0; i < result.size() / 2; ++i) {
132132
result(2 * i + index_place_even) =
133133
periodic_scalar_product(coeffs.head(Nlow), low_even, i + even_offset) +
134134
periodic_scalar_product(coeffs.tail(Nhigh), high_even, i + even_offset);

cpp/tests/communicator.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ TEST_CASE("Creates an mpi communicator") {
6060
auto const result = world.scatter_one(scattered);
6161
REQUIRE(result == world.rank() + 2);
6262
auto const gathered = world.gather(result);
63-
for (decltype(gathered)::size_type i = 0; i < gathered.size(); i++)
63+
for (decltype(gathered)::size_type i = 0; i < gathered.size(); ++i)
6464
CHECK(gathered[i] == scattered[i]);
6565
} else {
6666
auto const result = world.scatter_one<t_int>();
@@ -160,7 +160,7 @@ TEST_CASE("Creates an mpi communicator") {
160160
Vector<t_int>::Constant(std::accumulate(sizes.begin(), sizes.end(), 0), world.rank());
161161
const Vector<t_int> output = world.all_to_allv(sendee, sizes);
162162
t_int sum = 0;
163-
for (t_int i = 0; i < world.size() - 1; i++) {
163+
for (t_int i = 0; i < world.size() - 1; ++i) {
164164
const Vector<t_int> expected = Vector<t_int>::Constant(i + 1, i + 1);
165165
CAPTURE(sum);
166166
CAPTURE(i);

cpp/tests/credible_region.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ TEST_CASE("calculating gamma") {
1919
};
2020
const t_Vector x = t_Vector::Random(N);
2121
CHECK(0 == energy_function(x));
22-
for (t_uint i = 1; i < 10; i++) {
22+
for (t_uint i = 1; i < 10; ++i) {
2323
const t_real alpha = 0.9 + i * 0.01;
2424
const t_real gamma = credible_region::compute_energy_upper_bound(alpha, x, energy_function);
2525
CHECK(gamma == Approx(N * (std::sqrt(16 * std::log(3 / (1 - alpha)) / N) + 1)));

cpp/tests/gradient_operator.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ TEST_CASE("Gradient Operator") {
2626
Image const image = sopt::notinstalled::read_standard_tiff("cameraman256");
2727
auto const psi = sopt::gradient_operator::gradient_operator<Scalar>(image.rows(), image.cols());
2828
Matrix input = Matrix::Ones(image.rows(), image.cols());
29-
for (Eigen::Index i(0); i < image.rows(); i++) input.row(i) *= static_cast<Scalar>(i);
29+
for (Eigen::Index i(0); i < image.rows(); ++i) input.row(i) *= static_cast<Scalar>(i);
3030
Vector output = psi.adjoint() * Vector::Map(input.data(), input.size());
3131
CAPTURE(output.segment(0, 5));
3232
CAPTURE(output.segment(image.size(), 5));
@@ -35,7 +35,7 @@ TEST_CASE("Gradient Operator") {
3535
CHECK(output.segment(input.size(), input.size() - 1)
3636
.isApprox(Vector::Constant(0.5, input.size() - 1)));
3737
input = Matrix::Ones(image.rows(), image.cols());
38-
for (Eigen::Index i(0); i < image.cols(); i++) input.col(i) *= static_cast<Scalar>(i);
38+
for (Eigen::Index i(0); i < image.cols(); ++i) input.col(i) *= static_cast<Scalar>(i);
3939
output = psi.adjoint() * Vector::Map(input.data(), input.size());
4040
CAPTURE(output.segment(0, 5));
4141
CAPTURE(output.segment(image.size(), 5));

cpp/tests/inpainting.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ TEST_CASE("Inpainting"){
5050

5151
std::normal_distribution<> gaussian_dist(0, sigma);
5252
Vector y(y0.size());
53-
for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(*mersenne);
53+
for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(*mersenne);
5454

5555
sopt::t_real const gamma = 18;
5656
sopt::t_real const beta = sigma * sigma * 0.5;

cpp/tests/serial_vs_parallel_padmm.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ TEST_CASE("Parallel vs serial inpainting") {
6969
std::normal_distribution<> gaussian_dist(0, sigma);
7070
Vector y = world.is_root() ? y0 : world.broadcast<Vector>();
7171
if (world.is_root()) {
72-
for (sopt::t_int i = 0; i < y0.size(); i++) y(i) += gaussian_dist(*mersenne);
72+
for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) += gaussian_dist(*mersenne);
7373
world.broadcast(y);
7474
}
7575
if (split_comm.size() > 1) {

cpp/tests/tf_inpainting.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ TEST_CASE("Inpainting"){
4646

4747
std::normal_distribution<> gaussian_dist(0, sigma);
4848
Vector y(y0.size());
49-
for (sopt::t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(*mersenne);
49+
for (sopt::t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(*mersenne);
5050

5151
sopt::t_real const gamma = 18;
5252
sopt::t_real const beta = sigma * sigma * 0.5;

cpp/tests/wavelets.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void check_round_trip(Eigen::ArrayBase<T0> const &input_, sopt::t_uint db,
6060
}
6161

6262
TEST_CASE("wavelet data") {
63-
for (sopt::t_int num = 1; num < 100; num++) {
63+
for (sopt::t_int num = 1; num < 100; ++num) {
6464
if (num < 39)
6565
REQUIRE(sopt::wavelets::daubechies_data(num).coefficients.size() == 2 * num);
6666
else

cpp/tools_for_tests/inpainting.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Vector<T> dirty(sopt::LinearTransform<Vector<T>> const &sampling, sopt::Image<T>
2929
auto const y0 = target(sampling, image);
3030
std::normal_distribution<> gaussian_dist(0, sigma(sampling, image));
3131
Vector<T> y(y0.size());
32-
for (t_int i = 0; i < y0.size(); i++) y(i) = y0(i) + gaussian_dist(mersenne);
32+
for (t_int i = 0; i < y0.size(); ++i) y(i) = y0(i) + gaussian_dist(mersenne);
3333

3434
return y;
3535
}

0 commit comments

Comments
 (0)