Skip to content

Commit 37334c1

Browse files
committed
Linting
1 parent 8212d76 commit 37334c1

File tree

5 files changed

+21
-13
lines changed

5 files changed

+21
-13
lines changed

cpp/example/padmm_mpi_random_coverage.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ std::shared_ptr<sopt::algorithm::ImagingProximalADMM<t_complex>> padmm_factory(
9292
sara.size()) *
9393
1e-3;
9494
PURIFY_LOW_LOG("Epsilon {}, Rank = {}", epsilon, comm.rank());
95-
PURIFY_LOW_LOG("Regulariser_Strength {}, SARA Size = {}, Rank = {}", regulariser_strength, sara.size(), comm.rank());
95+
PURIFY_LOW_LOG("Regulariser_Strength {}, SARA Size = {}, Rank = {}", regulariser_strength,
96+
sara.size(), comm.rank());
9697

9798
// shared pointer because the convergence function need access to some data that we would rather
9899
// not reproduce. E.g. padmm definition is self-referential.

cpp/example/padmm_mpi_real_data.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,13 @@ std::shared_ptr<sopt::algorithm::ImagingProximalADMM<t_complex>> padmm_factory(
130130
if (comm.is_root()) PURIFY_MEDIUM_LOG("Step size γ {}", padmm->regulariser_strength());
131131
*iter = *iter + 1;
132132
Vector<t_complex> const alpha = padmm->Psi().adjoint() * x;
133-
const t_real new_regulariser_strength = comm.all_reduce(alpha.real().cwiseAbs().maxCoeff(), MPI_MAX) * 1e-3;
133+
const t_real new_regulariser_strength =
134+
comm.all_reduce(alpha.real().cwiseAbs().maxCoeff(), MPI_MAX) * 1e-3;
134135
if (comm.is_root()) PURIFY_MEDIUM_LOG("Step size γ update {}", new_regulariser_strength);
135-
padmm->regulariser_strength(((std::abs(padmm->regulariser_strength() - new_regulariser_strength) > 0.2) and *iter < 200) ? new_regulariser_strength
136-
: padmm->regulariser_strength());
136+
padmm->regulariser_strength(
137+
((std::abs(padmm->regulariser_strength() - new_regulariser_strength) > 0.2) and *iter < 200)
138+
? new_regulariser_strength
139+
: padmm->regulariser_strength());
137140
// updating parameter
138141

139142
Vector<t_complex> const residual = padmm->Phi().adjoint() * (uv_data.vis - padmm->Phi() * x);

cpp/example/padmm_random_coverage.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,11 @@ void padmm(const std::string &name, const Image<t_complex> &M31, const std::stri
9090
auto const padmm =
9191
sopt::algorithm::ImagingProximalADMM<t_complex>(uv_data.vis)
9292
.itermax(500)
93-
.regulariser_strength((Psi.adjoint() * (measurements_transform->adjoint() * uv_data.vis).eval())
94-
.cwiseAbs()
95-
.maxCoeff() *
96-
1e-3)
93+
.regulariser_strength(
94+
(Psi.adjoint() * (measurements_transform->adjoint() * uv_data.vis).eval())
95+
.cwiseAbs()
96+
.maxCoeff() *
97+
1e-3)
9798
.relative_variation(1e-3)
9899
.l2ball_proximal_epsilon(epsilon)
99100
.tight_frame(false)

cpp/example/padmm_real_data.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ void padmm(const std::string &name, const t_uint &imsizex, const t_uint &imsizey
5454
pfitsio::write2d(Image<t_real>::Map(dimage.data(), imsizey, imsizex), dirty_image_fits);
5555
pfitsio::write2d(Image<t_real>::Map(psf.data(), imsizey, imsizex), psf_image_fits);
5656
auto const epsilon = 3 * std::sqrt(2 * uv_data.size()) * sigma;
57-
auto const regulariser_strength = (measurements_transform->adjoint() * uv_data.vis).real().maxCoeff() * 1e-3;
57+
auto const regulariser_strength =
58+
(measurements_transform->adjoint() * uv_data.vis).real().maxCoeff() * 1e-3;
5859
PURIFY_HIGH_LOG("Using epsilon of {}", epsilon);
5960
#ifdef PURIFY_CImg
6061
auto const canvas = std::make_shared<CDisplay>(
@@ -107,8 +108,10 @@ void padmm(const std::string &name, const t_uint &imsizex, const t_uint &imsizey
107108
// updating parameter
108109
const t_real new_regulariser_strength = alpha.real().cwiseAbs().maxCoeff() * 1e-3;
109110
PURIFY_MEDIUM_LOG("Step size γ update {}", new_regulariser_strength);
110-
padmm->regulariser_strength(((std::abs(padmm->regulariser_strength() - new_regulariser_strength) > 0.2) and *iter < 200) ? new_regulariser_strength
111-
: padmm->regulariser_strength());
111+
padmm->regulariser_strength(
112+
((std::abs(padmm->regulariser_strength() - new_regulariser_strength) > 0.2) and *iter < 200)
113+
? new_regulariser_strength
114+
: padmm->regulariser_strength());
112115

113116
Vector<t_complex> const residual = padmm->Phi().adjoint() * (uv_data.vis - padmm->Phi() * x);
114117

cpp/example/sara_padmm_random_coverage.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ int main(int, char **) {
8080
.maxCoeff() *
8181
beta;
8282

83-
// auto purify_regulariser_strength = 3 * utilities::median((Psi.adjoint() * (measurements_transform.adjoint() *
84-
// (uv_data.vis - y0))).real().cwiseAbs())/0.6745;
83+
// auto purify_regulariser_strength = 3 * utilities::median((Psi.adjoint() *
84+
// (measurements_transform.adjoint() * (uv_data.vis - y0))).real().cwiseAbs())/0.6745;
8585

8686
SOPT_INFO("Using epsilon of {} \n", epsilon);
8787
auto const padmm = sopt::algorithm::ImagingProximalADMM<t_complex>(uv_data.vis)

0 commit comments

Comments
 (0)