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)},
33 std::map<std::string_view, solver_builder_func_t> builders{
37 if (direction.empty())
38 direction =
"newtontr";
39 auto builder_it = builders.find(direction);
40 if (builder_it != builders.end())
41 return builder_it->second(direction, opts);
43 throw std::invalid_argument(
44 "Unknown direction '" + std::string(direction) +
"'\n" +
45 " Available directions: " +
47 [](
const auto &x) {
return x.first; }));
53 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)
std::decay_t< decltype(Tag)> tag_t
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)
solver_func_t make_pantr_driver(std::string_view direction, Options &opts)
std::function< solver_free_func_t > solver_func_t
Double-precision double configuration.
std::string format_string_list(const auto &container, const auto &proj=[](const auto &x) -> decltype(auto) { return x;})