autogenu-jupyter
An automatic code generator and the continuation/GMRES (C/GMRES) based numerical solvers for nonlinear MPC
Loading...
Searching...
No Matches
solver_settings.hpp
Go to the documentation of this file.
1#ifndef CGMRES__SOLVER_SETTINGS_HPP_
2#define CGMRES__SOLVER_SETTINGS_HPP_
3
4#include <iostream>
5
6#include "cgmres/types.hpp"
7
8namespace cgmres {
9
20 size_t max_iter = 100;
21
27 Scalar opterr_tol = 1.0e-04;
28
34
41
49 Scalar zeta = 1000.0;
50
58 Scalar min_dummy = 1.0e-03;
59
63 size_t verbose_level = 0;
64
68 bool profile_solver = true;
69
70 void disp(std::ostream& os) const {
71 os << "Soler settings: " << std::endl;
72 os << " max iter: " << max_iter << std::endl;
73 os << " opterr tol: " << opterr_tol << std::endl;
74 os << " finite difference epsilon: " << finite_difference_epsilon << std::endl;
75 os << " sampling_time: " << sampling_time << std::endl;
76 os << " zeta: " << zeta << std::endl;
77 os << " min dummy: " << min_dummy << std::endl;
78 os << " verbose level: " << verbose_level << std::endl;
79 os << " profile solver: " << std::boolalpha << profile_solver << std::endl;
80 }
81
82 friend std::ostream& operator<<(std::ostream& os, const SolverSettings& settings) {
83 settings.disp(os);
84 return os;
85 }
86};
87
88} // namespace cgmres
89
90#endif // CGMRES__SOLVER_SETTINGS_HPP_
Definition: continuation_gmres.hpp:11
double Scalar
Alias of double.
Definition: types.hpp:11
Settings of solvers.
Definition: solver_settings.hpp:14
size_t max_iter
Maximum number of iterations of the ZeroHorizonOCPSolver method. Has nothing to do with SingleShootin...
Definition: solver_settings.hpp:20
Scalar min_dummy
The minimum value of the dummy inputs. Mainly used in MultipleShootingCGMRESSolver....
Definition: solver_settings.hpp:58
Scalar finite_difference_epsilon
Epsilon of the finite difference approximation. Must be positive. Default value is 1....
Definition: solver_settings.hpp:33
Scalar opterr_tol
Termination criterion of the ZeroHorizonOCPSolver method. Has nothing to do with SingleShootingCGMRES...
Definition: solver_settings.hpp:27
void disp(std::ostream &os) const
Definition: solver_settings.hpp:70
friend std::ostream & operator<<(std::ostream &os, const SolverSettings &settings)
Definition: solver_settings.hpp:82
Scalar sampling_time
The sampling time of MPC and used in SingleShootingCGMRESSolver and MultipleShootingCGMRESSolver....
Definition: solver_settings.hpp:40
Scalar zeta
The stabilization parameter of the continuation method. Typical value is the reciprocal of SolverSett...
Definition: solver_settings.hpp:49
size_t verbose_level
Verbose level. 0: no printings. 1-2: print some things. Default is 0.
Definition: solver_settings.hpp:63
bool profile_solver
If true, a solver profile is taken.
Definition: solver_settings.hpp:68