"""
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())
# 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())
"""
# 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()
# 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())
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())
#
# 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