@@ -56,14 +56,21 @@ template <class Real> void test_ackley() {
5656 std::array<Real, 2 > initial_guess{0 , 0 };
5757 jso_params.initial_guess = &initial_guess;
5858 local_minima = jso (ack, jso_params, gen);
59+
60+ #if (defined(BOOST_GCC) && ((BOOST_GCC >= 80000) && (BOOST_GCC < 90000)))
61+ using std::fabs;
62+ CHECK_LE (fabs (local_minima[0 ]), 128 * boost::math::tools::epsilon<Real>());
63+ CHECK_LE (fabs (local_minima[1 ]), 128 * boost::math::tools::epsilon<Real>());
64+ #else
5965 CHECK_EQUAL (local_minima[0 ], Real (0 ));
6066 CHECK_EQUAL (local_minima[1 ], Real (0 ));
67+ #endif
6168}
6269
6370template <class Real > void test_rosenbrock_saddle () {
6471 std::cout << " Testing jSO on Rosenbrock saddle . . .\n " ;
6572 using ArgType = std::array<Real, 2 >;
66- auto jso_params = jso_parameters<ArgType>() ;
73+ jso_parameters<ArgType> jso_params { } ;
6774 jso_params.lower_bounds = {0.5 , 0.5 };
6875 jso_params.upper_bounds = {2.048 , 2.048 };
6976 std::mt19937_64 gen (234568 );
@@ -157,14 +164,12 @@ void test_dimensioned_sphere() {
157164#endif
158165
159166int main () {
160- #if defined(__clang__) || defined(_MSC_VER)
161167 test_ackley<float >();
162168 test_ackley<double >();
163169 test_rosenbrock_saddle<double >();
164170 test_rastrigin<double >();
165171 test_three_hump_camel<float >();
166172 test_beale<double >();
167- #endif
168173#if BOOST_MATH_TEST_UNITS_COMPATIBILITY
169174 test_dimensioned_sphere ();
170175#endif
0 commit comments