alpaqa pi-pico
Nonconvex constrained optimization
Loading...
Searching...
No Matches
solverstatus.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <alpaqa/export.h>
4
5#include <iosfwd>
6#include <stdexcept>
7
8namespace alpaqa {
9
10/// Exit status of a numerical solver such as ALM or PANOC.
11enum class SolverStatus {
12 Busy = 0, ///< In progress.
13 Converged, ///< Converged and reached given tolerance.
14 MaxTime, ///< Maximum allowed execution time exceeded.
15 MaxIter, ///< Maximum number of iterations exceeded.
16 NotFinite, ///< Intermediate results were infinite or not-a-number.
17 NoProgress, ///< No progress was made in the last iteration.
18 Interrupted, ///< Solver was interrupted by the user.
19 Exception, ///< An unexpected exception was thrown.
20};
21
22/// @related SolverStatus
23inline constexpr const char *enum_name(SolverStatus s) {
24 using Status = SolverStatus;
25 switch (s) {
26 case Status::Busy: return "Busy";
27 case Status::Converged: return "Converged";
28 case Status::MaxTime: return "MaxTime";
29 case Status::MaxIter: return "MaxIter";
30 case Status::NotFinite: return "NotFinite";
31 case Status::NoProgress: return "NoProgress";
32 case Status::Interrupted: return "Interrupted";
33 case Status::Exception: return "Exception";
34 default:;
35 }
36 throw std::out_of_range("invalid value for alpaqa::SolverStatus");
37}
38
39/// @related SolverStatus
40ALPAQA_EXPORT std::ostream &operator<<(std::ostream &, SolverStatus);
41
42} // namespace alpaqa
std::ostream & operator<<(std::ostream &os, PANOCStopCrit s)
SolverStatus
Exit status of a numerical solver such as ALM or PANOC.
@ Interrupted
Solver was interrupted by the user.
@ MaxTime
Maximum allowed execution time exceeded.
@ Exception
An unexpected exception was thrown.
@ NoProgress
No progress was made in the last iteration.
@ MaxIter
Maximum number of iterations exceeded.
@ Busy
In progress.
@ Converged
Converged and reached given tolerance.
@ NotFinite
Intermediate results were infinite or not-a-number.
constexpr const auto inf
Definition config.hpp:112
constexpr const char * enum_name(LBFGSStepSize s)
Definition lbfgs.hpp:229