16auto make_inner_lbfgsb_solver(
Options &opts) {
18 InnerLBFGSBSolver::Params solver_param;
19 solver_param.max_iter = 50'000;
20 solver_param.print_interval = 0;
23 return InnerLBFGSBSolver{solver_param};
26template <
class LoadedProblem>
29 if (!direction.empty())
30 throw std::invalid_argument(
31 "L-BFGS-B solver does not support any directions");
33 std::shared_ptr<collector_t> collector;
34 auto inner_solver = make_inner_lbfgsb_solver(opts);
35 bool extra_stats =
false;
38 collector = std::make_shared<collector_t>();
39 inner_solver.set_progress_callback(
40 [collector](
const auto &progress_info) {
41 collector->update_iter(progress_info);
47 auto run = [solver{std::move(solver)},
53 return std::make_shared<AlpaqaSolverWrapperStats<config_t>>(
54 std::move(run), std::move(collector));
61 static constexpr bool valid_config =
62 std::is_same_v<LoadedProblem::config_t, InnerLBFGSBSolver::config_t>;
63 if constexpr (valid_config)
64 return make_lbfgsb_driver_impl<LoadedProblem>(direction, opts);
66 throw std::invalid_argument(
67 "L-BFGS-B solver only supports double precision");
77 throw std::invalid_argument(
78 "This version of alpaqa was compiled without L-BFGS-B support.");
SolverResults run_alm_solver(LoadedProblem &problem, Solver &solver, std::ostream &os, unsigned N_exp)
auto make_alm_solver(InnerSolver &&inner_solver, Options &opts)
Augmented Lagrangian Method solver.
SharedSolverWrapper make_lbfgsb_driver(std::string_view, Options &)
@ ProjGradUnitNorm
∞-norm of the projected gradient with unit step size:
auto attach_cancellation(Solver &solver)
Attach SIGINT and SIGTERM handlers to stop the given solver.
decltype(auto) set_params(T &t, std::string_view prefix, Options &opts)
std::shared_ptr< SolverWrapper > SharedSolverWrapper