This module contains the main :class:`SymmetricLinearGame` class that
knows how to solve a linear game.
"""
-from math import sqrt
-
from cvxopt import matrix, printing, solvers
from .cones import CartesianProduct, IceCream, NonnegativeOrthant
from .errors import GameUnsolvableException, PoorScalingException
# 45-45-90 triangle and the shortest distance to the
# outside of the cone should be 1/sqrt(2) of that.
# It works in R^2, so it works everywhere, right?
+ # We use "2" because it's better numerically than sqrt(2).
height = self.e1()[0]
radius = norm(self.e1()[1:])
- dist = (height - radius) / sqrt(2)
+ dist = (height - radius) / 2
else:
raise NotImplementedError
# 45-45-90 triangle and the shortest distance to the
# outside of the cone should be 1/sqrt(2) of that.
# It works in R^2, so it works everywhere, right?
+ # We use "2" because it's better numerically than sqrt(2).
height = self.e2()[0]
radius = norm(self.e2()[1:])
- dist = (height - radius) / sqrt(2)
+ dist = (height - radius) / 2
else:
raise NotImplementedError