suite.addTest(DocTestSuite(games, optionflags=ELLIPSIS))
suite.addTest(DocTestSuite(matrices, optionflags=ELLIPSIS))
suite.addTest(DocTestSuite(symmetric_linear_game_test))
- suite.addTest(DocTestSuite(randomgen))
+ suite.addTest(DocTestSuite(randomgen, optionflags=ELLIPSIS))
slg_tests = TestLoader().loadTestsFromModule(symmetric_linear_game_test)
suite.addTest(slg_tests)
mat_tests = TestLoader().loadTestsFromModule(matrices_test)
SymmetricLinearGame
A random game over some nonnegative orthant.
+ Examples
+ --------
+
+ >>> random_orthant_game()
+ <dunshire.games.SymmetricLinearGame object at 0x...>
+
"""
ambient_dim = random_natural() + 1
K = NonnegativeOrthant(ambient_dim)
SymmetricLinearGame
A random game over some ice-cream cone.
+ Examples
+ --------
+
+ >>> random_icecream_game()
+ <dunshire.games.SymmetricLinearGame object at 0x...>
+
"""
# Use a minimum dimension of two to avoid divide-by-zero in
# the fudge factor we make up later.
A random game over some nonnegative orthant whose ``payoff`` method
is based on a Lyapunov-like ``L`` operator.
+ Examples
+ --------
+
+ >>> random_ll_orthant_game()
+ <dunshire.games.SymmetricLinearGame object at 0x...>
+
"""
G = random_orthant_game()
L = random_diagonal_matrix(G._K.dimension())
A random game over some ice-cream cone whose ``payoff`` method
is based on a Lyapunov-like ``L`` operator.
+ Examples
+ --------
+
+ >>> random_ll_icecream_game()
+ <dunshire.games.SymmetricLinearGame object at 0x...>
+
"""
G = random_icecream_game()
L = random_lyapunov_like_icecream(G._K.dimension())
A random game over some nonnegative orthant whose ``payoff`` method
is based on a positive ``L`` operator.
+ Examples
+ --------
+
+ >>> random_positive_orthant_game()
+ <dunshire.games.SymmetricLinearGame object at 0x...>
+
"""
G = random_orthant_game()
(float, SymmetricLinearGame)
A pair containing the both the scaling factor and the new scaled game.
+ Examples
+ --------
+
+ >>> from dunshire.matrices import norm
+ >>> from dunshire.options import ABS_TOL
+ >>> G = random_orthant_game()
+ >>> (alpha, H) = random_nn_scaling(G)
+ >>> alpha >= 0
+ True
+ >>> G._K == H._K
+ True
+ >>> norm(G._e1 - H._e1) < ABS_TOL
+ True
+ >>> norm(G._e2 - H._e2) < ABS_TOL
+ True
+
"""
alpha = random_nn_scalar()
H = SymmetricLinearGame(alpha*G._L.trans(), G._K, G._e1, G._e2)
A pair containing the both the translation distance and the new
scaled game.
+ Examples
+ --------
+
+ >>> from dunshire.matrices import norm
+ >>> from dunshire.options import ABS_TOL
+ >>> G = random_orthant_game()
+ >>> (alpha, H) = random_translation(G)
+ >>> G._K == H._K
+ True
+ >>> norm(G._e1 - H._e1) < ABS_TOL
+ True
+ >>> norm(G._e2 - H._e2) < ABS_TOL
+ True
+
"""
alpha = random_scalar()
tensor_prod = G._e1 * G._e2.trans()