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