' e1 = {:s},\n' \
' e2 = {:s},\n' \
' Condition((L, K, e1, e2)) = {:f}.'
' e1 = {:s},\n' \
' e2 = {:s},\n' \
' Condition((L, K, e1, e2)) = {:f}.'
- indented_L = '\n '.join(str(self._L).splitlines())
- indented_e1 = '\n '.join(str(self._e1).splitlines())
- indented_e2 = '\n '.join(str(self._e2).splitlines())
+ indented_L = '\n '.join(str(self.L()).splitlines())
+ indented_e1 = '\n '.join(str(self.e1()).splitlines())
+ indented_e2 = '\n '.join(str(self.e2()).splitlines())
- return matrix([0, self._e2], (1, self.dimension() + 1), 'd')
+ return matrix([0, self.e2()], (1, self.dimension() + 1), 'd')
"""
identity_matrix = identity(self.dimension())
return append_row(append_col(self._zero(), -identity_matrix),
"""
identity_matrix = identity(self.dimension())
return append_row(append_col(self._zero(), -identity_matrix),
# Oops, CVXOPT tried to take the square root of a
# negative number. Report some details about the game
# rather than just the underlying CVXOPT crash.
# Oops, CVXOPT tried to take the square root of a
# negative number. Report some details about the game
# rather than just the underlying CVXOPT crash.
# that CVXOPT is convinced the problem is infeasible (and that
# cannot happen).
if soln_dict['status'] in ['primal infeasible', 'dual infeasible']:
# that CVXOPT is convinced the problem is infeasible (and that
# cannot happen).
if soln_dict['status'] in ['primal infeasible', 'dual infeasible']:
raise GameUnsolvableException(self, soln_dict)
# The "optimal" and "unknown" results, we actually treat the
raise GameUnsolvableException(self, soln_dict)
# The "optimal" and "unknown" results, we actually treat the
# it) because otherwise CVXOPT might return "unknown" and give
# us two points in the cone that are nowhere near optimal.
if abs(p1_value - p2_value) > 2*options.ABS_TOL:
# it) because otherwise CVXOPT might return "unknown" and give
# us two points in the cone that are nowhere near optimal.
if abs(p1_value - p2_value) > 2*options.ABS_TOL:
raise GameUnsolvableException(self, soln_dict)
# And we also check that the points it gave us belong to the
# cone, just in case...
if (p1_optimal not in self._K) or (p2_optimal not in self._K):
raise GameUnsolvableException(self, soln_dict)
# And we also check that the points it gave us belong to the
# cone, just in case...
if (p1_optimal not in self._K) or (p2_optimal not in self._K):
raise GameUnsolvableException(self, soln_dict)
# For the game value, we could use any of:
raise GameUnsolvableException(self, soln_dict)
# For the game value, we could use any of:
Condition((L, K, e1, e2)) = 44.476...
"""
Condition((L, K, e1, e2)) = 44.476...
"""