delpi
0.0.1
DElta-complete LP solver
Toggle main menu visibility
Loading...
Searching...
No Matches
LpResult.cpp
1
6
#include "delpi/solver/LpResult.h"
7
8
#include <ostream>
9
10
#include "delpi/util/error.h"
11
12
namespace
delpi
{
13
14
std::ostream &operator<<(std::ostream &os,
const
LpResult
result) {
15
switch
(result) {
16
case
LpResult::UNSOLVED
:
17
return
os <<
"unsolved"
;
18
case
LpResult::OPTIMAL
:
19
return
os <<
"optimal"
;
20
case
LpResult::DELTA_OPTIMAL
:
21
return
os <<
"delta-optimal"
;
22
case
LpResult::UNBOUNDED
:
23
return
os <<
"unbounded"
;
24
case
LpResult::INFEASIBLE
:
25
return
os <<
"infeasible"
;
26
case
LpResult::ERROR
:
27
return
os <<
"error"
;
28
default
:
29
DELPI_UNREACHABLE();
30
}
31
}
32
33
LpResult
operator~
(
const
LpResult
result) {
34
switch
(result) {
35
case
LpResult::OPTIMAL
:
36
case
LpResult::DELTA_OPTIMAL
:
37
return
LpResult::DELTA_OPTIMAL
;
38
default
:
39
return
result;
40
}
41
}
42
43
bool
IsFeasible
(
const
LpResult
result) {
44
switch
(result) {
45
case
LpResult::OPTIMAL
:
46
case
LpResult::DELTA_OPTIMAL
:
47
case
LpResult::UNBOUNDED
:
48
return
true
;
49
default
:
50
return
false
;
51
}
52
}
53
int
ExitCode
(
const
LpResult
result) {
54
switch
(result) {
55
case
LpResult::OPTIMAL
:
56
case
LpResult::DELTA_OPTIMAL
:
57
case
LpResult::UNBOUNDED
:
58
case
LpResult::INFEASIBLE
:
59
return
0;
60
case
LpResult::ERROR
:
61
return
1;
62
default
:
63
return
2;
64
}
65
}
66
67
}
// namespace delpi
delpi
Global namespace for the delpi library.
delpi::LpResult
LpResult
Possible outcomes of the LP solver.
Definition
LpResult.h:14
delpi::LpResult::INFEASIBLE
@ INFEASIBLE
The problem is infeasible.
Definition
LpResult.h:19
delpi::LpResult::DELTA_OPTIMAL
@ DELTA_OPTIMAL
The delta-relaxation of the problem is optimal.
Definition
LpResult.h:17
delpi::LpResult::UNBOUNDED
@ UNBOUNDED
The problem is unbounded.
Definition
LpResult.h:18
delpi::LpResult::ERROR
@ ERROR
An error occurred.
Definition
LpResult.h:20
delpi::LpResult::OPTIMAL
@ OPTIMAL
The problem is optimal.
Definition
LpResult.h:16
delpi::LpResult::UNSOLVED
@ UNSOLVED
The solver has not yet been run.
Definition
LpResult.h:15
delpi::IsFeasible
bool IsFeasible(const LpResult result)
Check if the result obtained by the LpSolver implies that the problem is feasible.
Definition
LpResult.cpp:43
delpi::operator~
LpResult operator~(const LpResult result)
Relax the result of the theory solver (i.e.
Definition
LpResult.cpp:33
delpi::ExitCode
int ExitCode(const LpResult result)
Convert the result in.
Definition
LpResult.cpp:53
delpi
solver
LpResult.cpp
Generated by
1.17.0