+def _random_nonnegative_matrix(dims):
+ """
+ Generate a random square (``dims``-by-``dims``) matrix with
+ nonnegative entries, represented as a list of rows. This is used
+ only by the :class:`SymmetricLinearGameTest` class.
+ """
+ L = _random_matrix(dims)
+ return [[abs(entry) for entry in row] for row in L]
+
+def _random_diagonal_matrix(dims):
+ """
+ Generate a random square (``dims``-by-``dims``) matrix with nonzero
+ entries only on the diagonal, represented as a list of rows. This is
+ used only by the :class:`SymmetricLinearGameTest` class.
+ """
+ return [[uniform(-10, 10)*int(i == j) for i in range(dims)]
+ for j in range(dims)]