]> gitweb.michael.orlitzky.com - dunshire.git/blobdiff - doc/README.rst
Enable doctesting of ReST docs with `make doctest`.
[dunshire.git] / doc / README.rst
index 46407670a2ad0b3d57a9ec8cff98a9f792c1f186..71876c6271b7912198acd51aa41afef0f7ef6adc 100644 (file)
@@ -63,40 +63,43 @@ game over both of those cones.
 
 First, we use the nonnegative orthant in :math:`\mathbb{R}^{2}`:
 
->>> from dunshire import *
->>> K = NonnegativeOrthant(2)
->>> L = [[1,0],[0,1]]
->>> e1 = [1,1]
->>> e2 = e1
->>> G = SymmetricLinearGame(L,K,e1,e2)
->>> print(G.solution())
-Game value: 0.5000000
-Player 1 optimal:
-  [0.5000000]
-  [0.5000000]
-Player 2 optimal:
-  [0.5000000]
-  [0.5000000]
+.. doctest::
+
+  >>> from dunshire import *
+  >>> K = NonnegativeOrthant(2)
+  >>> L = [[1,0],[0,1]]
+  >>> e1 = [1,1]
+  >>> e2 = e1
+  >>> G = SymmetricLinearGame(L,K,e1,e2)
+  >>> print(G.solution())
+  Game value: 0.5000000
+  Player 1 optimal:
+    [0.5000000]
+    [0.5000000]
+  Player 2 optimal:
+    [0.5000000]
+    [0.5000000]
 
 Next we try the Lorentz ice-cream cone in :math:`\mathbb{R}^{2}`:
 
->>> from dunshire import *
->>> K = IceCream(2)
->>> L = [[1,0],[0,1]]
->>> e1 = [1,1]
->>> e2 = e1
->>> G = SymmetricLinearGame(L,K,e1,e2)
->>> print(G.solution())
-Game value: 0.5000000
-Player 1 optimal:
-  [0.5000000]
-  [0.5000000]
-Player 2 optimal:
-  [0.5000000]
-  [0.5000000]
-
-(The answer when :math:`L`, :math:`e_{1}`, and :math:`e_{2}` are so
-simple is independent of the cone.)
+.. doctest::
+
+  >>> from dunshire import *
+  >>> K = IceCream(2)
+  >>> L = [[1,0],[0,1]]
+  >>> e1 = [1,1]
+  >>> e2 = e1
+  >>> G = SymmetricLinearGame(L,K,e1,e2)
+  >>> print(G.solution())
+  Game value: 0.5000000
+  Player 1 optimal:
+    [0.8347039]
+    [0.1652961]
+  Player 2 optimal:
+    [0.5000000]
+    [0.5000000]
+
+Note that these solutions are not unique, although the game values are.
 
 Requirements
 ------------