|
cyqlone
develop
Fast, parallel and vectorized solver for linear systems with optimal control structure.
|
#include <benchmark/benchmark.h>#include <cyqlone/matio.hpp>#include <cyqlone/qpalm/backends/ocp-backend-cyqlone.hpp>#include <cyqlone/qpalm/example-problems/spring-mass.hpp>#include <cyqlone/qpalm/settings.hpp>#include <cyqlone/qpalm/solver.hpp>#include <cyqlone/qpalm/status.hpp>#include <cyqlone/tracing.hpp>#include <CLI/CLI.hpp>#include <batmat/dtypes.hpp>#include <batmat/lut.hpp>#include <batmat/openmp.h>#include <guanaqo/demangled-typename.hpp>#include <guanaqo/pcm/counters.hpp>#include <guanaqo/perfetto/trace.hpp>#include <guanaqo/string-util.hpp>#include <guanaqo/stringify.h>#include <batmat-version.h>#include <cyqlone-version.h>#include <algorithm>#include <cstdlib>#include <filesystem>#include <format>#include <generator>#include <map>#include <optional>#include <random>#include <stdexcept>#include <utility>#include "hpipm.hpp"Go to the source code of this file.
Classes | |
| struct | Options |
| struct | Problem |
| struct | Solver |
| struct | SpringMassParams |
Typedefs | |
| using | seconds = std::chrono::duration<double> |
Enumerations | |
| enum class | ProblemType { WangBoyd2008 , WangBoyd2008Width , Domahidi2012 , ActiveStateConstr } |
| enum class | WarmStartHPIPM { NoWarmStart , WarmZero , WarmCopy , WarmShift } |
Functions | |
| auto | counter (auto x) |
| auto | counter_avg (auto x) |
| qp::problems::SpringMassProblem | create_problem (const SpringMassParams ¶ms) |
| void | disable_tracing () |
| void | trace_run (auto &&, const auto &) |
| void | print_traces (std::ostream &) |
| template<index_t VL, qp::StorageOrder Order> | |
| void | run_benchmark (benchmark::State &state, const std::string ¶m_name, const SpringMassParams ¶ms, qp::CyQPALMBackendSettings backend_settings, qp::Settings settings, bool warm=false, bool trace=false) |
| std::generator< Problem > | get_spring_mass_params (const Options &opts) |
| void | export_problem (const Options &opts) |
| std::string_view | order (qp::StorageOrder o) |
| template<index_t VL, qp::StorageOrder O> | |
| std::generator< Solver > | get_cyqlone_solvers (const Options &opts) |
| std::generator< Solver > | get_hpipm_solvers (const Options &opts) |
| template<qp::StorageOrder Order> | |
| std::generator< Solver > | get_cyqlone_solvers_vl (const Options &opts) |
| std::generator< Solver > | get_solvers (const Options &opts) |
| auto | register_benchmarks (const Options &opts) |
| std::unique_ptr< benchmark::BenchmarkReporter > | make_custom_reporter (size_t problem_name_width, size_t solver_name_width, bool print_extra, bool with_color) |
| void | register_options (const char *program, CLI::App &app, Options &opts) |
| int | initialize_google_benchmark (char *program, auto bm_args) |
| void | register_context () |
| int | main (int argc, char **argv) |
Variables | |
| constexpr auto | v_native = std::is_same_v<batmat::real_t, double> ? 4 : 8 |
| constexpr auto | v = batmat::types::vl_at_most<batmat::real_t, v_native> |
| const std::map< std::string, ProblemType > | problem_type_map |
| struct Options |
| Class Members | ||
|---|---|---|
| bool | cold = true | |
| bool | warm_shift = true | |
| bool | warm_copy = false | |
| bool | no_updates = false | |
| vector< int > | parallelism = {8} | |
| vector< int > | vector_length = {v} | |
| bool | rm = false | |
| bool | cm = true | |
| bool | pcr = true | |
| bool | hpipm = false | |
| vector< int > | horizon {32, 64, 96, 128, 192, 256} | |
| vector< int > | masses {6, 12, 30} | |
| uint64_t | num_instances = 50 | |
| uint64_t | seed = 0 | |
| ProblemType | problem_type = ProblemType::WangBoyd2008 | |
| double | pcr_max_update_fraction = 0.25 | |
| double | cr_max_update_fraction = 0.9 | |
| int | parallel_solve_cr_threshold = 10 | |
| int | parallel_factor_pcr_threshold = 20 | |
| double | changing_constr_factor = 0.01 | |
| bool | custom_reporter = true | |
| bool | print_extra = false | |
| bool | use_color = false | |
| bool | trace = false | |
| string | export_problem {} | |
| struct Problem |
| Class Members | ||
|---|---|---|
| string | name | |
| SpringMassParams | params | |
| using seconds = std::chrono::duration<double> |
Definition at line 104 of file spring-mass.cpp.
|
strong |
| Enumerator | |
|---|---|
| WangBoyd2008 | |
| WangBoyd2008Width | |
| Domahidi2012 | |
| ActiveStateConstr | |
Definition at line 55 of file spring-mass.cpp.
|
strong |
| Enumerator | |
|---|---|
| NoWarmStart | |
| WarmZero | |
| WarmCopy | |
| WarmShift | |
Definition at line 234 of file spring-mass.cpp.
| auto counter | ( | auto | x | ) |
Definition at line 48 of file spring-mass.cpp.
| auto counter_avg | ( | auto | x | ) |
Definition at line 51 of file spring-mass.cpp.
| qp::problems::SpringMassProblem create_problem | ( | const SpringMassParams & | params | ) |
Definition at line 106 of file spring-mass.cpp.
| void disable_tracing | ( | ) |
Definition at line 162 of file spring-mass.cpp.
| void trace_run | ( | auto && | , |
| const auto & | ) |
Definition at line 163 of file spring-mass.cpp.
| void print_traces | ( | std::ostream & | ) |
Definition at line 164 of file spring-mass.cpp.
| void run_benchmark | ( | benchmark::State & | state, |
| const std::string & | param_name, | ||
| const SpringMassParams & | params, | ||
| qp::CyQPALMBackendSettings | backend_settings, | ||
| qp::Settings | settings, | ||
| bool | warm = false, | ||
| bool | trace = false ) |
Definition at line 168 of file spring-mass.cpp.
Definition at line 286 of file spring-mass.cpp.
| void export_problem | ( | const Options & | opts | ) |
Definition at line 320 of file spring-mass.cpp.
| std::string_view order | ( | qp::StorageOrder | o | ) |
Definition at line 340 of file spring-mass.cpp.
| std::generator< Solver > get_cyqlone_solvers | ( | const Options & | opts | ) |
Definition at line 343 of file spring-mass.cpp.
Definition at line 401 of file spring-mass.cpp.
| std::generator< Solver > get_cyqlone_solvers_vl | ( | const Options & | opts | ) |
Definition at line 425 of file spring-mass.cpp.
Definition at line 440 of file spring-mass.cpp.
| auto register_benchmarks | ( | const Options & | opts | ) |
Definition at line 448 of file spring-mass.cpp.
| std::unique_ptr< benchmark::BenchmarkReporter > make_custom_reporter | ( | size_t | problem_name_width, |
| size_t | solver_name_width, | ||
| bool | print_extra, | ||
| bool | with_color ) |
| void register_options | ( | const char * | program, |
| CLI::App & | app, | ||
| Options & | opts ) |
Definition at line 474 of file spring-mass.cpp.
| int initialize_google_benchmark | ( | char * | program, |
| auto | bm_args ) |
Definition at line 531 of file spring-mass.cpp.
| void register_context | ( | ) |
Definition at line 544 of file spring-mass.cpp.
| int main | ( | int | argc, |
| char ** | argv ) |
Definition at line 599 of file spring-mass.cpp.
|
constexpr |
Definition at line 44 of file spring-mass.cpp.
|
constexpr |
Definition at line 46 of file spring-mass.cpp.
| const std::map<std::string, ProblemType> problem_type_map |
Definition at line 61 of file spring-mass.cpp.