X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dunshire.git;a=blobdiff_plain;f=test%2Fsymmetric_linear_game_test.py;h=da72fd03cca7215602ff81174a906795ffc189a9;hp=470cf6a116aeb578a89450671abfbb6f73f1e9de;hb=c07958ae171cbe3a5dbbb72118cd7c7df3c42770;hpb=10dfe7d7edb69701dd8f4f955f3f325706d77e47 diff --git a/test/symmetric_linear_game_test.py b/test/symmetric_linear_game_test.py index 470cf6a..da72fd0 100644 --- a/test/symmetric_linear_game_test.py +++ b/test/symmetric_linear_game_test.py @@ -13,18 +13,22 @@ from .randomgen import (RANDOM_MAX, random_icecream_game, random_nn_scaling, random_orthant_game, random_positive_orthant_game, random_translation) -EPSILON = 2*2*RANDOM_MAX*options.ABS_TOL +EPSILON = (1 + RANDOM_MAX)*options.ABS_TOL """ This is the tolerance constant including fudge factors that we use to determine whether or not two numbers are equal in tests. -The factor of two is because if we compare two solutions, both -of which may be off by ``ABS_TOL``, then the result could be off -by ``2*ABS_TOL``. The factor of ``RANDOM_MAX`` allows for -scaling a result (by ``RANDOM_MAX``) that may be off by -``ABS_TOL``. The final factor of two is to allow for the edge -cases where we get an "unknown" result and need to lower the -CVXOPT tolerance by a factor of two. +Often we will want to compare two solutions, say for games that are +equivalent. If the first game value is low by ``ABS_TOL`` and the second +is high by ``ABS_TOL``, then the total could be off by ``2*ABS_TOL``. We +also subject solutions to translations and scalings, which adds to or +scales their error. If the first game is low by ``ABS_TOL`` and the +second is high by ``ABS_TOL`` before scaling, then after scaling, the +second could be high by ``RANDOM_MAX*ABS_TOL``. That is the rationale +for the factor of ``1 + RANDOM_MAX`` in ``EPSILON``. Since ``1 + +RANDOM_MAX`` is greater than ``2*ABS_TOL``, we don't need to handle the +first issue mentioned (both solutions off by the same amount in opposite +directions). """ # Tell pylint to shut up about the large number of methods.