forked from pz4kybsvg/Conception
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.1 KiB
35 lines
1.1 KiB
#include "drake/solvers/solution_result.h"
|
|
|
|
namespace drake {
|
|
namespace solvers {
|
|
std::string to_string(SolutionResult solution_result) {
|
|
switch (solution_result) {
|
|
case SolutionResult::kSolutionFound:
|
|
return "SolutionFound";
|
|
case SolutionResult::kInvalidInput:
|
|
return "InvalidInput";
|
|
case SolutionResult::kInfeasibleConstraints:
|
|
return "InfeasibleConstraints";
|
|
case SolutionResult::kUnbounded:
|
|
return "Unbounded";
|
|
case SolutionResult::kInfeasibleOrUnbounded:
|
|
return "InfeasibleOrUnbounded";
|
|
case SolutionResult::kIterationLimit:
|
|
return "IterationLimit";
|
|
case SolutionResult::kUnknownError:
|
|
return "UnknownError";
|
|
case SolutionResult::kDualInfeasible:
|
|
return "DualInfeasible";
|
|
}
|
|
// The following lines should not be reached, we add this line due to a defect
|
|
// in the compiler.
|
|
throw std::runtime_error("Should not reach here");
|
|
}
|
|
|
|
std::ostream& operator<<(std::ostream& os, SolutionResult solution_result) {
|
|
os << to_string(solution_result);
|
|
return os;
|
|
}
|
|
} // namespace solvers
|
|
} // namespace drake
|