diff --git a/test/test_lbfgs.cpp b/test/test_lbfgs.cpp index e12995069..ffb86108b 100644 --- a/test/test_lbfgs.cpp +++ b/test/test_lbfgs.cpp @@ -72,7 +72,6 @@ struct analytic_gradient_eval_pol } }; -// -- Test L-BFGS with custom initialization policy (zero_init_policy) BOOST_AUTO_TEST_CASE_TEMPLATE(custom_init_lbfgs_test, T, all_float_types) { constexpr size_t M = 8; @@ -94,94 +93,4 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(custom_init_lbfgs_test, T, all_float_types) } } -// // -- Test L-BFGS with analytic derivative policies -// BOOST_AUTO_TEST_CASE_TEMPLATE(analytic_lbfgs_test, T, all_float_types) -// { -// constexpr size_t M = 10; -// const T eps = T{ 1e-3 }; - -// RandomSample rng{ T(-5), T(5) }; -// std::vector x(3); -// for (auto& xi : x) -// xi = rng.next(); - -// auto opt = bopt::make_lbfgs( -// &quadratic>, // Objective -// x, // Arguments -// M, // History size -// bopt::random_uniform_initializer_rvar{}, // Initialization -// analytic_objective_eval_pol{}, // Function eval -// analytic_gradient_eval_pol{} // Gradient eval -// ); - -// // Run optimization (manual loop or minimize wrapper) -// auto result = minimize(opt); - -// for (auto& xi : x) { -// BOOST_REQUIRE_SMALL(xi, eps); -// } -// } - -// // -- Test L-BFGS with analytic policies and custom line search -// // (strong_wolfe_line_search_policy) -// BOOST_AUTO_TEST_CASE_TEMPLATE(analytic_lbfgs_strong_wolfe_test, -// T, -// all_float_types) -// { -// constexpr size_t M = 12; -// const T eps = T{ 1e-4 }; - -// RandomSample rng{ T(-10), T(10) }; -// std::vector x(5); -// for (auto& xi : x) -// xi = rng.next(); - -// auto opt = bopt::make_lbfgs( -// &quadratic, -// x, -// M, -// boost::math::optimization::random_uniform_initializer_rvar{}, -// analytic_objective_eval_pol{}, -// analytic_gradient_eval_pol{}, -// boost::math::optimization::armijo_line_search_policy{}); - -// auto result = minimize(opt); - -// for (auto& xi : x) { -// BOOST_REQUIRE_SMALL(xi, eps); -// } -// } - -// // -- Test L-BFGS with random init policy (demonstrates flexible -// initialization) template struct random_init_policy -// { -// RandomSample rng{ RealType(-1), RealType(1) }; -// void operator()(std::vector& x) const noexcept -// { -// for (auto& xi : x) -// xi = rng.next(); -// } -// }; - -// BOOST_AUTO_TEST_CASE_TEMPLATE(random_init_lbfgs_test, T, all_float_types) -// { -// constexpr size_t M = 6; -// const T eps = T{ 1e-4 }; - -// std::vector x(4); -// random_init_policy{}(x); // Apply initialization manually - -// auto opt = bopt::make_lbfgs(&quadratic, -// x, -// M, -// random_init_policy{}, -// analytic_objective_eval_pol{}, -// analytic_gradient_eval_pol{}); - -// auto result = minimize(opt); - -// for (auto& xi : x) { -// BOOST_REQUIRE_SMALL(xi, eps); -// } -// } BOOST_AUTO_TEST_SUITE_END()