From: Michael Orlitzky Date: Tue, 11 Oct 2016 13:52:13 +0000 (-0400) Subject: Add a test for an example in the Gowda/Ravindran paper. X-Git-Tag: 0.1.0~166 X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dunshire.git;a=commitdiff_plain;h=27bdc001c36113b5b95837ba32820383c263ca81 Add a test for an example in the Gowda/Ravindran paper. --- diff --git a/src/dunshire/games.py b/src/dunshire/games.py index 9f0b0ce..8383a96 100644 --- a/src/dunshire/games.py +++ b/src/dunshire/games.py @@ -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)