// Status returned by the solver. They follow a hierarchical nomenclature, to
// allow us to add more enum values in the future. Clients should use
// InCategory() to match these enums, with the following C++ pseudo-code:
//
// bool InCategory(MPSolverResponseStatus status, MPSolverResponseStatus cat) {
// if (cat == MPSOLVER_OPTIMAL) return status == MPSOLVER_OPTIMAL;
// while (status > cat) status >>= 4;
// return status == cat;
// }
enum MPSolverResponseStatus {
// Normal responses -- the model was valid, and the solver ran.
// These statuses should be "somewhat" repeatable, modulo the fact that the
// solver's time limit makes it undeterministic, and could change a FEASIBLE
// model to an OPTIMAL and vice-versa (the others, except NOT_SOLVED, should
// normally be deterministic). Also, the solver libraries can be buggy.
// The solver found the proven optimal solution. This is what should be
// returned in most cases.
//
// WARNING: for historical reason, the value is zero, which means that this
// value can't have any subcategories.
MPSOLVER_OPTIMAL = 0x0;
// The solver had enough time to find some solution that satisfies all
// constraints, but it did not prove optimality (which means it may or may
// not have reached the optimal).
//
// This can happen for large LP models (Linear Programming), and is a frequent
// response for time-limited MIPs (Mixed Integer Programming). In the MIP
// case, the difference between the solution 'objective_value' and
// 'best_objective_bound' fields of the MPSolutionResponse will give an
// indication of how far this solution is from the optimal one.
MPSOLVER_FEASIBLE = 0x1;
// The model does not have any solution, according to the solver (which
// "proved" it, with the caveat that numerical proofs aren't actual proofs),
// or based on trivial considerations (eg. a variable whose lower bound is
// strictly greater than its upper bound).
MPSOLVER_INFEASIBLE = 0x2;
// There exist solutions that make the magnitude of the objective value
// as large as wanted (i.e. -infinity (resp. +infinity) for a minimization
// (resp. maximization) problem.
MPSOLVER_UNBOUNDED = 0x3;
// An error (most probably numerical) occurred.
// One likely cause for such errors is a large numerical range among variable
// coefficients (eg. 1e-16, 1e20), in which case one should try to shrink it.
MPSOLVER_ABNORMAL = 0x4;
// The solver did not have a chance to diagnose the model in one of the
// categories above.
MPSOLVER_NOT_SOLVED = 0x6;