]> gitweb.michael.orlitzky.com - dunshire.git/commitdiff
Use player1_start() as the primal starting point and fix some tests.
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 11 Nov 2016 02:32:48 +0000 (21:32 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 13 Nov 2016 20:19:26 +0000 (15:19 -0500)
dunshire/games.py

index 3ed89bb3f2f70b30d0313cbe5a578e4f53e47421..77c83300a586e7e9f8a98a766d242f98738635f1 100644 (file)
@@ -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':