9#include "sleipnir/util/symbol_exports.hpp"
16enum class ExitStatus : int8_t {
20 CALLBACK_REQUESTED_STOP = 1,
24 LOCALLY_INFEASIBLE = -2,
27 GLOBALLY_INFEASIBLE = -3,
29 FACTORIZATION_FAILED = -4,
32 LINE_SEARCH_FAILED = -5,
34 NONFINITE_INITIAL_COST_OR_CONSTRAINTS = -6,
36 DIVERGING_ITERATES = -7,
39 MAX_ITERATIONS_EXCEEDED = -8,
50SLEIPNIR_DLLEXPORT
constexpr std::string_view to_message(
51 const ExitStatus& exit_status) {
52 using enum ExitStatus;
54 switch (exit_status) {
57 case CALLBACK_REQUESTED_STOP:
58 return "callback requested stop";
60 return "too few degrees of freedom";
61 case LOCALLY_INFEASIBLE:
62 return "locally infeasible";
63 case GLOBALLY_INFEASIBLE:
64 return "globally infeasible";
65 case FACTORIZATION_FAILED:
66 return "factorization failed";
67 case LINE_SEARCH_FAILED:
68 return "line search failed";
69 case NONFINITE_INITIAL_COST_OR_CONSTRAINTS:
70 return "nonfinite initial cost or constraints";
71 case DIVERGING_ITERATES:
72 return "diverging iterates";
73 case MAX_ITERATIONS_EXCEEDED:
74 return "max iterations exceeded";