X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dunshire.git;a=blobdiff_plain;f=test%2Fsymmetric_linear_game_test.py;h=bba2f7ccfcb48c38312e5d5849aae892d40eac31;hp=936a7e869283b4fd9ee2e82ddccefa5ef7253658;hb=2b44481f8a79cbab75ddc0f73eea813b66e17d62;hpb=eacd89382ec94c3e4f86386c3970dbcc09d5448d diff --git a/test/symmetric_linear_game_test.py b/test/symmetric_linear_game_test.py index 936a7e8..bba2f7c 100644 --- a/test/symmetric_linear_game_test.py +++ b/test/symmetric_linear_game_test.py @@ -66,8 +66,7 @@ class SymmetricLinearGameTest(TestCase): # pylint: disable=R0904 """ soln = G.solution() - expected = inner_product(G._L*soln.player1_optimal(), - soln.player2_optimal()) + expected = G.payoff(soln.player1_optimal(), soln.player2_optimal()) self.assert_within_tol(soln.game_value(), expected, G.condition()) @@ -171,7 +170,7 @@ class SymmetricLinearGameTest(TestCase): # pylint: disable=R0904 # Make sure the same optimal pair works. self.assert_within_tol(value2, - inner_product(H._L*x_bar, y_bar), + H.payoff(x_bar, y_bar), H.condition()) @@ -200,11 +199,11 @@ class SymmetricLinearGameTest(TestCase): # pylint: disable=R0904 """ # This is the "correct" representation of ``M``, but # COLUMN indexed... - M = -G._L.trans() + M = -G.L().trans() # so we have to transpose it when we feed it to the constructor. # Note: the condition number of ``H`` should be comparable to ``G``. - H = SymmetricLinearGame(M.trans(), G._K, G._e2, G._e1) + H = SymmetricLinearGame(M.trans(), G.K(), G.e2(), G.e1()) soln1 = G.solution() x_bar = soln1.player1_optimal() @@ -217,7 +216,7 @@ class SymmetricLinearGameTest(TestCase): # pylint: disable=R0904 # Make sure the switched optimal pair works. self.assert_within_tol(soln2.game_value(), - inner_product(M*y_bar, x_bar), + H.payoff(y_bar, x_bar), H.condition()) @@ -249,10 +248,10 @@ class SymmetricLinearGameTest(TestCase): # pylint: disable=R0904 y_bar = soln.player2_optimal() value = soln.game_value() - ip1 = inner_product(y_bar, G._L*x_bar - value*G._e1) + ip1 = inner_product(y_bar, G.L()*x_bar - value*G.e1()) self.assert_within_tol(ip1, 0, G.condition()) - ip2 = inner_product(value*G._e2 - G._L.trans()*y_bar, x_bar) + ip2 = inner_product(value*G.e2() - G.L().trans()*y_bar, x_bar) self.assert_within_tol(ip2, 0, G.condition()) @@ -298,7 +297,7 @@ class SymmetricLinearGameTest(TestCase): # pylint: disable=R0904 # # See :meth:`assert_within_tol` for an explanation of the # fudge factors. - eigs = eigenvalues_re(G._L) + eigs = eigenvalues_re(G.L()) if soln.game_value() > EPSILON: # L should be positive stable