WPILibC++ 2027.0.0-alpha-2
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/**
13 * Solver options.
14 */
16 /// The solver will stop once the error is below this tolerance.
17 double tolerance = 1e-8;
18
19 /// The maximum number of solver iterations before returning a solution.
20 int max_iterations = 5000;
21
22 /// The maximum elapsed wall clock time before returning a solution.
23 std::chrono::duration<double> timeout{
24 std::numeric_limits<double>::infinity()};
25
26 /// Enables the feasible interior-point method. When the inequality
27 /// constraints are all feasible, step sizes are reduced when necessary to
28 /// prevent them becoming infeasible again. This is useful when parts of the
29 /// problem are ill-conditioned in infeasible regions (e.g., square root of a
30 /// negative value). This can slow or prevent progress toward a solution
31 /// though, so only enable it if necessary.
32 bool feasible_ipm = false;
33
34 /// Enables diagnostic prints.
35 ///
36 /// <table>
37 /// <tr>
38 /// <th>Heading</th>
39 /// <th>Description</th>
40 /// </tr>
41 /// <tr>
42 /// <td>iter</td>
43 /// <td>Iteration number</td>
44 /// </tr>
45 /// <tr>
46 /// <td>type</td>
47 /// <td>Iteration type (normal, accepted second-order correction, rejected
48 /// second-order correction)</td>
49 /// </tr>
50 /// <tr>
51 /// <td>time (ms)</td>
52 /// <td>Duration of iteration in milliseconds</td>
53 /// </tr>
54 /// <tr>
55 /// <td>error</td>
56 /// <td>Error estimate</td>
57 /// </tr>
58 /// <tr>
59 /// <td>cost</td>
60 /// <td>Cost function value at current iterate</td>
61 /// </tr>
62 /// <tr>
63 /// <td>infeas.</td>
64 /// <td>Constraint infeasibility at current iterate</td>
65 /// </tr>
66 /// <tr>
67 /// <td>complement.</td>
68 /// <td>Complementary slackness at current iterate (sᵀz)</td>
69 /// </tr>
70 /// <tr>
71 /// <td>μ</td>
72 /// <td>Barrier parameter</td>
73 /// </tr>
74 /// <tr>
75 /// <td>reg</td>
76 /// <td>Iteration matrix regularization</td>
77 /// </tr>
78 /// <tr>
79 /// <td>primal α</td>
80 /// <td>Primal step size</td>
81 /// </tr>
82 /// <tr>
83 /// <td>dual α</td>
84 /// <td>Dual step size</td>
85 /// </tr>
86 /// <tr>
87 /// <td>↩</td>
88 /// <td>Number of line search backtracks</td>
89 /// </tr>
90 /// </table>
91 bool diagnostics = false;
92};
93
94} // namespace slp
Definition expression_graph.hpp:11
Solver options.
Definition options.hpp:15
#define SLEIPNIR_DLLEXPORT
Definition symbol_exports.hpp:34