Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit b5f5f91

Browse files
committedMar 27, 2016
Infeasible problems are bounded!
1 parent 5777ef9 commit b5f5f91

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed
 

‎src/sage/numerical/interactive_simplex_method.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -1100,8 +1100,17 @@ def is_bounded(self):
11001100
sage: P = InteractiveLPProblem(A, b, c, ["C", "B"], variable_type=">=")
11011101
sage: P.is_bounded()
11021102
True
1103+
1104+
Note that infeasible problems are always bounded::
1105+
1106+
sage: b = (-1000, 1500)
1107+
sage: P = InteractiveLPProblem(A, b, c, variable_type=">=")
1108+
sage: P.is_feasible()
1109+
False
1110+
sage: P.is_bounded()
1111+
True
11031112
"""
1104-
return self._solve()[0] is not None
1113+
return self.optimal_solution() is not None or not self.is_feasible()
11051114

11061115
def is_feasible(self):
11071116
r"""
@@ -1120,7 +1129,7 @@ def is_feasible(self):
11201129
sage: P.is_feasible()
11211130
True
11221131
"""
1123-
return self._solve()[1] is not None
1132+
return self.optimal_value() is not None
11241133

11251134
def is_primal(self):
11261135
r"""

0 commit comments

Comments
 (0)
This repository has been archived.