From 7a8c5ae6859bb0a9bf577b2c043ebb01760fabab Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Mon, 18 Oct 2021 11:37:18 -0400 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Marcus Edel --- tests/moead_test.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/moead_test.cpp b/tests/moead_test.cpp index 051a3203d..33034b057 100644 --- a/tests/moead_test.cpp +++ b/tests/moead_test.cpp @@ -516,7 +516,6 @@ TEST_CASE("MOEADZDTONETest", "[MOEADTest]") ZDT1<> ZDT_ONE(100); const double lowerBound = 0; const double upperBound = 1; - double g = DBL_MAX; DefaultMOEAD opt( 300, // Population size. @@ -548,7 +547,7 @@ TEST_CASE("MOEADZDTONETest", "[MOEADTest]") //! The optimal g value is taken from the docs of ZDT_ONE. size_t numVariables = coords.size(); double sum = arma::accu(coords(arma::span(1, numVariables - 1), 0)); - g = 1. + 9. * sum / (static_cast(numVariables - 1)); + const double g = 1.0 + 9.0 * sum / (static_cast(numVariables - 1)); if (trial < trials - 1 && g != Approx(1.0).margin(0.99)) continue;