cyqlone develop
Fast, parallel and vectorized solver for linear systems with optimal control structure.
Loading...
Searching...
No Matches
status.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cyqlone/config.hpp>
4#include <cyqlone/qpalm/export.h>
5#include <iosfwd>
6#include <stdexcept>
7
8namespace cyqlone::qpalm {
9
10/// Exit status of a numerical solver.
11/// @ingroup topic-optimization-solvers
12enum class SolverStatus {
13 Busy = 0, ///< In progress.
14 Converged, ///< Converged and reached given tolerance.
15 MaxTime, ///< Maximum allowed execution time exceeded.
16 MaxIter, ///< Maximum number of iterations exceeded.
17 NotFinite, ///< Intermediate results were infinite or not-a-number.
18 NoProgress, ///< No progress was made in the last iteration.
19 Interrupted, ///< Solver was interrupted by the user.
20 Exception, ///< An unexpected exception was thrown.
21};
22
23inline const char *enum_name(SolverStatus s) {
24 switch (s) {
25 case SolverStatus::Busy: return "Busy";
26 case SolverStatus::Converged: return "Converged";
27 case SolverStatus::MaxTime: return "MaxTime";
28 case SolverStatus::MaxIter: return "MaxIter";
29 case SolverStatus::NotFinite: return "NotFinite";
30 case SolverStatus::NoProgress: return "NoProgress";
31 case SolverStatus::Interrupted: return "Interrupted";
32 case SolverStatus::Exception: return "Exception";
33 default:;
34 }
35 throw std::out_of_range("invalid value for qpalm::SolverStatus");
36}
37
38CYQLONE_QPALM_EXPORT std::ostream &operator<<(std::ostream &os, SolverStatus s);
39
40} // namespace cyqlone::qpalm
SolverStatus
Exit status of a numerical solver.
Definition status.hpp:12
@ Interrupted
Solver was interrupted by the user.
Definition status.hpp:19
@ MaxTime
Maximum allowed execution time exceeded.
Definition status.hpp:15
@ Exception
An unexpected exception was thrown.
Definition status.hpp:20
@ NoProgress
No progress was made in the last iteration.
Definition status.hpp:18
@ MaxIter
Maximum number of iterations exceeded.
Definition status.hpp:16
@ Converged
Converged and reached given tolerance.
Definition status.hpp:14
@ NotFinite
Intermediate results were infinite or not-a-number.
Definition status.hpp:17
const char * enum_name(SolverStatus s)
Definition status.hpp:23
std::ostream & operator<<(std::ostream &os, SolverStatus s)
Definition status.cpp:6