18template <
template <
class Direction>
class Solver>
19solver_func_t make_panoc_like_driver(std::string_view direction,
20 [[maybe_unused]]
Options &opts) {
22 auto builder = []<
class Direction>(tag_t<Direction>) {
24 auto inner_solver = make_inner_solver<Solver<Direction>>(opts);
28 return [solver{std::move(solver)},
31 static std::atomic<
decltype(solver) *> solver_to_stop;
32 auto cancel = attach_cancellation<solver_to_stop>(solver);
37 std::map<std::string_view, solver_builder_func_t> builders{
45 if (direction.empty())
47 auto builder_it = builders.find(direction);
48 if (builder_it != builders.end())
49 return builder_it->second(direction, opts);
51 throw std::invalid_argument(
52 "Unknown direction '" + std::string(direction) +
"'\n" +
53 " Available directions: " +
55 [](
const auto &x) {
return x.first; }));
61 return make_panoc_like_driver<alpaqa::PANOCSolver>(direction, opts);
65 return make_panoc_like_driver<alpaqa::ZeroFPRSolver>(direction, opts);
SolverResults run_alm_solver(LoadedProblem &problem, Solver &solver, std::ostream &os, unsigned N_exp)
auto make_alm_solver(InnerSolver &&inner_solver, Options &opts)
#define USING_ALPAQA_CONFIG(Conf)
decltype(auto) set_params(T &t, std::string_view prefix, Options &opts)
solver_func_t make_panoc_driver(std::string_view direction, Options &opts)
solver_func_t make_zerofpr_driver(std::string_view direction, Options &opts)
std::function< solver_free_func_t > solver_func_t
std::string format_string_list(const auto &container, const auto &proj=[](const auto &x) -> decltype(auto) { return x;})