Nonconvex constrained optimization
Loading...
Searching...
No Matches
alpaqa-driver.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <alpaqa/drivers-export.h>
4
7
10
11#include <filesystem>
12#include <iosfwd>
13#include <map>
14#include <span>
15#include <string_view>
16#include <tuple>
17
18namespace alpaqa::driver {
19
20namespace fs = std::filesystem;
21using namespace std::string_view_literals;
22
23ALPAQA_DRIVERS_EXPORT void print_usage(const char *a0, std::ostream &os);
24ALPAQA_DRIVERS_EXPORT void print_version(std::ostream &os);
25
26struct ALPAQA_DRIVERS_EXPORT SolverBuilders {
27 SolverBuilders(std::string default_solver = "panoc");
28 std::tuple<solver_builder_func, std::string>
30 void register_solver_builder(std::string_view name,
31 solver_builder_func builder);
32 std::string default_solver;
33 std::map<std::string_view, solver_builder_func> solvers;
34};
35
36ALPAQA_DRIVERS_EXPORT std::string
37store_solution(const fs::path &sol_output_dir, std::ostream &os,
38 BenchmarkResults &results, const SolverWrapper &solver,
39 [[maybe_unused]] const alpaqa::Options &opts,
40 std::span<const char *const> argv);
41
42ALPAQA_DRIVERS_EXPORT std::ostream &
43get_output_stream(alpaqa::Options &opts, std::ofstream &out_fstream,
44 std::ostream &default_stream);
45
46ALPAQA_DRIVERS_EXPORT std::string get_output_paths(alpaqa::Options &opts);
47
48ALPAQA_DRIVERS_EXPORT std::tuple<fs::path, std::string_view>
49get_problem_path(const char *const *argv);
50
51} // namespace alpaqa::driver
ALPAQA_DRIVERS_EXPORT std::string store_solution(const fs::path &sol_output_dir, std::ostream &os, BenchmarkResults &results, const SolverWrapper &solver, const alpaqa::Options &opts, std::span< const char *const > argv)
ALPAQA_DRIVERS_EXPORT std::string get_output_paths(alpaqa::Options &opts)
ALPAQA_DRIVERS_EXPORT std::ostream & get_output_stream(alpaqa::Options &opts, std::ofstream &out_fstream, std::ostream &default_stream)
ALPAQA_DRIVERS_EXPORT std::tuple< fs::path, std::string_view > get_problem_path(const char *const *argv)
ALPAQA_DRIVERS_EXPORT void print_version(std::ostream &os)
std::function< SharedSolverWrapper(std::string_view, alpaqa::Options &)> solver_builder_func
ALPAQA_DRIVERS_EXPORT void print_usage(const char *a0, std::ostream &os)
std::tuple< solver_builder_func, std::string > get_solver_builder(alpaqa::Options &opts) const
void register_solver_builder(std::string_view name, solver_builder_func builder)
SolverBuilders(std::string default_solver="panoc")
std::map< std::string_view, solver_builder_func > solvers