15template <
template <
class Direction>
class Solver>
16solver_func_t make_pantr_like_solver(std::string_view direction,
17 [[maybe_unused]]
Options &opts) {
19 auto builder = []<
class Direction>(tag_t<Direction>) {
21 auto inner_solver = make_inner_solver<Solver<Direction>>(opts);
25 return [solver{std::move(solver)},
28 static std::atomic<
decltype(solver) *> solver_to_stop;
29 auto cancel = attach_cancellation<solver_to_stop>(solver);
34 std::map<std::string_view, solver_builder_func_t> builders{
38 if (direction.empty())
39 direction =
"newtontr";
40 auto builder_it = builders.find(direction);
41 if (builder_it != builders.end())
42 return builder_it->second(direction, opts);
44 throw std::invalid_argument(
45 "Unknown direction '" + std::string(direction) +
"'\n" +
46 " Available directions: " +
48 [](
const auto &x) {
return x.first; }));
54 return make_pantr_like_solver<alpaqa::PANTRSolver>(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_pantr_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;})