Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Marcus Edel <[email protected]>
  • Loading branch information
rcurtin and zoq authored Oct 18, 2021
1 parent bd28574 commit 7a8c5ae
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/moead_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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<double>(numVariables - 1));
const double g = 1.0 + 9.0 * sum / (static_cast<double>(numVariables - 1));
if (trial < trials - 1 && g != Approx(1.0).margin(0.99))
continue;

Expand Down

0 comments on commit 7a8c5ae

Please sign in to comment.