]> gitweb.michael.orlitzky.com - dunshire.git/commitdiff
Add a test for an example in the Gowda/Ravindran paper.
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 11 Oct 2016 13:52:13 +0000 (09:52 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 11 Oct 2016 13:52:13 +0000 (09:52 -0400)
src/dunshire/games.py

index 9f0b0ced50628d387ef5fbe2b8d166aefc9bb6a8..8383a965d26e085e08befbd09f002b4806d312b6 100644 (file)
@@ -556,3 +556,15 @@ class SymmetricLinearGameTest(TestCase):
              for j in range(K.dimension())]
         self.assert_solution_exists(L, K, e1, e2)
 
+
+    def test_negative_value_Z_operator(self):
+        """
+        Test the example given in Gowda/Ravindran of a Z-matrix with
+        negative game value on the nonnegative orthant.
+        """
+        K = NonnegativeOrthant(2)
+        e1 = [1,1]
+        e2 = e1
+        L = [[1,-2],[-2,1]]
+        G = SymmetricLinearGame(L, K, e1, e2)
+        self.assertTrue(G.solution().game_value() < -options.ABS_TOL)