18 [[maybe_unused]]
Options &opts) {
20 auto builder = []<
class Direction>(
tag_t<Direction>) {
23 std::shared_ptr<collector_t> collector;
24 auto inner_solver = make_inner_solver<Solver<Direction>>(opts);
25 bool extra_stats =
false;
28 collector = std::make_shared<collector_t>();
29 inner_solver.set_progress_callback(
30 [collector](
const auto &progress_info) {
31 collector->update_iter(progress_info);
37 auto run = [solver{std::move(solver)},
43 return std::make_shared<AlpaqaSolverWrapperStats<config_t>>(
44 std::move(run), std::move(collector));
47 std::map<std::string_view, solver_builder_func> builders{
51 if (direction.empty())
52 direction =
"newtontr";
53 auto builder_it = builders.find(direction);
54 if (builder_it != builders.end())
55 return builder_it->second(direction, opts);
57 throw std::invalid_argument(
58 "Unknown direction '" + std::string(direction) +
"'\n" +
59 " Available directions: " +
61 [](
const auto &x) {
return x.first; }));