5#ifndef IDOL_SOLUTION_TYPES_H
6#define IDOL_SOLUTION_TYPES_H
12#include "idol/general/utils/exceptions/Exception.h"
43 bool is_in(T t_status, std::initializer_list<T> t_list) {
44 for (
auto status: t_list) {
45 if (status == t_status) {
53 bool is_in(
typename T::value_type t_status,
const T &t_list) {
54 for (
auto status: t_list) {
55 if (status == t_status) {
62 static SolutionStatus dual(SolutionStatus t_status) {
81 throw Exception(
"Unexpected status: " + std::to_string(t_status));
84 static std::ostream &operator<<(std::ostream &t_os, SolutionStatus t_status) {
88 return t_os <<
"Loaded";
90 return t_os <<
"Optimal";
92 return t_os <<
"Feasible";
94 return t_os <<
"Infeasible";
96 return t_os <<
"InfOrUnbnd";
98 return t_os <<
"Unbounded";
100 return t_os <<
"Fail";
102 return t_os <<
"SubOptimal";
106 throw Exception(
"Unexpected status: " + std::to_string(t_status));
109 static std::ostream &operator<<(std::ostream &t_os, SolutionReason t_status) {
113 return t_os <<
"Proved";
117 return t_os <<
"TimeLimit";
119 return t_os <<
"IterLimit";
121 return t_os <<
"ObjLimit";
123 return t_os <<
"Numerical";
125 return t_os <<
"MemoryLimit";
127 return t_os <<
"Cycling";
129 return t_os <<
"SolutionLimit";
133 throw Exception(
"Unexpected status: " + std::to_string(t_status));