19#include "absl/strings/ascii.h"
20#include "absl/strings/str_cat.h"
32 return "undefined (UNDEF)";
34 return "feasible (FEAS)";
36 return "infeasible (INFEAS)";
38 return "no feasible solution (NOFEAS)";
40 return "optimal (OPT)";
42 return "unbounded (UNBND)";
44 return absl::StrCat(
"? (",
status,
")");
53 return "lower bound (NL)";
55 return "upper bound (NU)";
57 return "unbounded (NF)";
61 return absl::StrCat(
"? (", stat,
")");
68 return "[GLP_EBADB] invalid basis";
70 return "[GLP_ESING] singular matrix";
72 return "[GLP_ECOND] ill-conditioned matrix";
74 return "[GLP_EBOUND] invalid bounds";
76 return "[GLP_EFAIL] solver failed";
78 return "[GLP_EOBJLL] objective lower limit reached";
80 return "[GLP_EOBJUL] objective upper limit reached";
82 return "[GLP_EITLIM] iteration limit exceeded";
84 return "[GLP_ETMLIM] time limit exceeded";
86 return "[GLP_ENOPFS] no primal feasible solution";
88 return "[GLP_ENODFS] no dual feasible solution";
90 return "[GLP_EROOT] root LP optimum not provided";
92 return "[GLP_ESTOP] search terminated by application";
94 return "[GLP_EMIPGAP] relative mip gap tolerance reached";
96 return "[GLP_ENOFEAS] no primal/dual feasible solution";
98 return "[GLP_ENOCVG] no convergence";
100 return "[GLP_EINSTAB] numerical instability";
102 return "[GLP_EDATA] invalid data";
104 return "[GLP_ERANGE] result out of range";
106 return absl::StrCat(
"[?] unknown return code ", rc);
111 std::ostringstream oss;
112 std::size_t current_size = 0;
113 for (
const char c : original_name) {
126 if (!absl::ascii_iscntrl(c)) {
136 const std::string escaped_c =
137 absl::StrCat(
"\\x", absl::Hex(c, absl::kZeroPad2));
142 current_size += escaped_c.size();
145 const std::string ret = oss.str();
#define DCHECK_EQ(val1, val2)
Collection of objects used to extend the Constraint Solver library.
std::string BasisStatusString(const int stat)
constexpr std::size_t kMaxGLPKNameLen
std::string ReturnCodeString(const int rc)
std::string SolutionStatusString(const int status)
std::string TruncateAndQuoteGLPKName(const std::string_view original_name)