From f5b5ef66e41ae0538eb32e4b8420c36a23b95361 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 11 Nov 2016 09:47:48 -0500 Subject: [PATCH] Use "2" as a numerically-better factor in player[12]_start(). --- dunshire/games.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dunshire/games.py b/dunshire/games.py index 0a47391..f9877b3 100644 --- a/dunshire/games.py +++ b/dunshire/games.py @@ -4,8 +4,6 @@ Symmetric linear games and their solutions. 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 @@ -833,9 +831,10 @@ class SymmetricLinearGame: # 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 @@ -862,9 +861,10 @@ class SymmetricLinearGame: # 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 -- 2.43.2