From fa3639d3a5cc52e104a81dc75d8688c64c274a71 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Thu, 10 Nov 2016 21:32:48 -0500 Subject: [PATCH] Use player1_start() as the primal starting point and fix some tests. --- dunshire/games.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/dunshire/games.py b/dunshire/games.py index 3ed89bb..77c8330 100644 --- a/dunshire/games.py +++ b/dunshire/games.py @@ -24,7 +24,7 @@ class Solution: -------- >>> print(Solution(10, matrix([1,2]), matrix([3,4]))) - Game value: 10.0000000 + Game value: 10.000... Player 1 optimal: [ 1] [ 2] @@ -880,11 +880,11 @@ class SymmetricLinearGame: >>> e2 = [1,1,1] >>> SLG = SymmetricLinearGame(L, K, e1, e2) >>> print(SLG.solution()) - Game value: -6.1724138 + Game value: -6.172... Player 1 optimal: - [ 0.551...] - [-0.000...] - [ 0.448...] + [0.551...] + [0.000...] + [0.448...] Player 2 optimal: [0.448...] [0.000...] @@ -900,7 +900,7 @@ class SymmetricLinearGame: >>> e2 = [4,5,6] >>> SLG = SymmetricLinearGame(L, K, e1, e2) >>> print(SLG.solution()) - Game value: 0.0312500 + Game value: 0.031... Player 1 optimal: [0.031...] [0.062...] @@ -936,8 +936,8 @@ class SymmetricLinearGame: >>> print(SLG.solution()) Game value: 18.767... Player 1 optimal: - [-0.000...] - [ 9.766...] + [0.000...] + [9.766...] Player 2 optimal: [1.047...] [0.000...] @@ -954,8 +954,8 @@ class SymmetricLinearGame: >>> print(SLG.solution()) Game value: 24.614... Player 1 optimal: - [ 6.371...] - [-0.000...] + [6.371...] + [0.000...] Player 2 optimal: [2.506...] [0.000...] @@ -969,6 +969,7 @@ class SymmetricLinearGame: self.C().cvxopt_dims(), self.A(), self.b(), + primalstart=self.player1_start(), options=opts) except ValueError as error: if str(error) == 'math domain error': -- 2.44.2