From a4dfb5ad782929dfa91de173a090cc8c645c741c Mon Sep 17 00:00:00 2001 From: Krishnakumar Gopalakrishnan Date: Thu, 22 Jun 2023 21:54:23 +0100 Subject: [PATCH] fix(unused): handle unused variables in the project --- cmake_files/using.cc | 2 +- cpp/examples/forward_backward/l2_inpainting.cc | 2 +- cpp/sopt/power_method.h | 2 +- cpp/tests/padmm.cc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake_files/using.cc b/cmake_files/using.cc index 8317a837b..80e55d869 100644 --- a/cmake_files/using.cc +++ b/cmake_files/using.cc @@ -8,6 +8,6 @@ class SARA : public std::vector { }; int main(int, char const**) { - SARA s = {0, 0}; + [[maybe_unused]] SARA s = {0, 0}; return 0; } diff --git a/cpp/examples/forward_backward/l2_inpainting.cc b/cpp/examples/forward_backward/l2_inpainting.cc index 0a330706d..0cdfac0ef 100644 --- a/cpp/examples/forward_backward/l2_inpainting.cc +++ b/cpp/examples/forward_backward/l2_inpainting.cc @@ -104,7 +104,7 @@ int main(int argc, char const **argv) { // Here, we default to (y, Φx/ν - y) Vector init_map = Vector::Ones(image.size()) * x_sigma; Vector init_res = y - (sampling * init_map); - const std::tuple warm_start = {init_map, init_res}; + // [[maybe_unused]] const std::tuple warm_start = {init_map, init_res}; auto const diagnostic = fb(); SOPT_HIGH_LOG("Forward backward returned {}", diagnostic.good); diff --git a/cpp/sopt/power_method.h b/cpp/sopt/power_method.h index c570c4871..a2e1d5f0c 100644 --- a/cpp/sopt/power_method.h +++ b/cpp/sopt/power_method.h @@ -151,7 +151,7 @@ class PowerMethod { //! Number of iterations t_uint niters; //! Wether convergence was achieved - bool good; + // [[maybe_unuse]] bool good; //! Magnitude of the eigenvalue Scalar magnitude; //! Corresponding eigenvector if converged diff --git a/cpp/tests/padmm.cc b/cpp/tests/padmm.cc index cf783da24..07c33bf3a 100644 --- a/cpp/tests/padmm.cc +++ b/cpp/tests/padmm.cc @@ -29,7 +29,7 @@ TEST_CASE("Proximal ADMM with ||x - x0||_2 functions", "[padmm][integration]") { t_Matrix const mId = -t_Matrix::Identity(N, N); - t_Vector const translation = t_Vector::Ones(N) * 5; + // [[maybe_unused]] t_Vector const translation = t_Vector::Ones(N) * 5; auto const padmm = algorithm::ProximalADMM(g0, g1, t_Vector::Zero(N)).Phi(mId).itermax(3000).gamma(0.01); auto const result = padmm();