WPILibC++ 2027.0.0-alpha-5
Loading...
Searching...
No Matches
options.hpp
Go to the documentation of this file.
1// Copyright (c) Sleipnir contributors
2
3#pragma once
4
5#include <chrono>
6#include <limits>
7
9
10namespace slp {
11
12/// Solver options.
14 /// The solver will stop once the error is below this tolerance.
15 double tolerance = 1e-8;
16
17 /// The maximum number of solver iterations before returning a solution.
18 int max_iterations = 5000;
19
20 /// The maximum elapsed wall clock time before returning a solution.
21 std::chrono::duration<double> timeout{
22 std::numeric_limits<double>::infinity()};
23
24 /// Enables the feasible interior-point method.
25 ///
26 /// When the inequality constraints are all feasible, step sizes are reduced
27 /// when necessary to prevent them becoming infeasible again. This is useful
28 /// when parts of the problem are ill-conditioned in infeasible regions (e.g.,
29 /// square root of a negative value). This can slow or prevent progress toward
30 /// a solution though, so only enable it if necessary.
31 bool feasible_ipm = false;
32
33 /// Enables diagnostic output.
34 ///
35 /// See https://sleipnirgroup.github.io/Sleipnir/md_usage.html#output for more
36 /// information.
37 bool diagnostics = false;
38};
39
40} // namespace slp
Definition to_underlying.hpp:7
Solver options.
Definition options.hpp:13
int max_iterations
The maximum number of solver iterations before returning a solution.
Definition options.hpp:18
double tolerance
The solver will stop once the error is below this tolerance.
Definition options.hpp:15
bool diagnostics
Enables diagnostic output.
Definition options.hpp:37
bool feasible_ipm
Enables the feasible interior-point method.
Definition options.hpp:31
std::chrono::duration< double > timeout
The maximum elapsed wall clock time before returning a solution.
Definition options.hpp:21
#define SLEIPNIR_DLLEXPORT
Definition symbol_exports.hpp:34