From: Michael Orlitzky Date: Thu, 20 Aug 2015 20:15:44 +0000 (-0400) Subject: Replace _rho with _restrict_to_space in cone/tests.py. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=85584cebbd0d2865f2a4ae56c9978e647fbde682;p=sage.d.git Replace _rho with _restrict_to_space in cone/tests.py. --- diff --git a/mjo/cone/tests.py b/mjo/cone/tests.py index b9dc2e0..e059d94 100644 --- a/mjo/cone/tests.py +++ b/mjo/cone/tests.py @@ -15,24 +15,24 @@ from sage.all import * # The double-import is needed to get the underscore methods. from mjo.cone.cone import * -from mjo.cone.cone import _basically_the_same, _rho +from mjo.cone.cone import _basically_the_same, _restrict_to_space # -# Tests for _rho. +# Tests for _restrict_to_space. # """ -Apply _rho according to our paper (to obtain our main result). Test all -four parameter combinations:: +Apply _restrict_to_space according to our paper (to obtain our main +result). Test all four parameter combinations:: sage: set_random_seed() sage: K = random_cone(max_ambient_dim = 8, ....: strictly_convex=False, ....: solid=False) - sage: K_S = _rho(K) - sage: K_SP = _rho(K_S.dual()).dual() + sage: K_S = _restrict_to_space(K, K.span()) + sage: K_SP = _restrict_to_space(K_S.dual(), K_S.dual().span()).dual() sage: K_SP.is_proper() True - sage: K_SP = _rho(K_S, K_S.dual()) + sage: K_SP = _restrict_to_space(K_S, K_S.dual().span()) sage: K_SP.is_proper() True @@ -42,11 +42,11 @@ four parameter combinations:: sage: K = random_cone(max_ambient_dim = 8, ....: strictly_convex=True, ....: solid=False) - sage: K_S = _rho(K) - sage: K_SP = _rho(K_S.dual()).dual() + sage: K_S = _restrict_to_space(K, K.span()) + sage: K_SP = _restrict_to_space(K_S.dual(), K_S.dual().span()).dual() sage: K_SP.is_proper() True - sage: K_SP = _rho(K_S, K_S.dual()) + sage: K_SP = _restrict_to_space(K_S, K_S.dual().span()) sage: K_SP.is_proper() True @@ -56,11 +56,11 @@ four parameter combinations:: sage: K = random_cone(max_ambient_dim = 8, ....: strictly_convex=False, ....: solid=True) - sage: K_S = _rho(K) - sage: K_SP = _rho(K_S.dual()).dual() + sage: K_S = _restrict_to_space(K, K.span()) + sage: K_SP = _restrict_to_space(K_S.dual(), K_S.dual().span()).dual() sage: K_SP.is_proper() True - sage: K_SP = _rho(K_S, K_S.dual()) + sage: K_SP = _restrict_to_space(K_S, K_S.dual().span()) sage: K_SP.is_proper() True @@ -70,11 +70,11 @@ four parameter combinations:: sage: K = random_cone(max_ambient_dim = 8, ....: strictly_convex=True, ....: solid=True) - sage: K_S = _rho(K) - sage: K_SP = _rho(K_S.dual()).dual() + sage: K_S = _restrict_to_space(K, K.span()) + sage: K_SP = _restrict_to_space(K_S.dual(), K_S.dual().span()).dual() sage: K_SP.is_proper() True - sage: K_SP = _rho(K_S, K_S.dual()) + sage: K_SP = _restrict_to_space(K_S, K_S.dual().span()) sage: K_SP.is_proper() True @@ -89,8 +89,8 @@ all parameter combinations:: ....: solid=False, ....: strictly_convex=False) sage: K = Cone(random_sublist(J.rays(), 0.5), lattice=J.lattice()) - sage: K_W_star = _rho(K, J).dual() - sage: K_star_W = _rho(K.dual(), J) + sage: K_W_star = _restrict_to_space(K, J.span()).dual() + sage: K_star_W = _restrict_to_space(K.dual(), J.span()) sage: _basically_the_same(K_W_star, K_star_W) True @@ -101,8 +101,8 @@ all parameter combinations:: ....: solid=True, ....: strictly_convex=False) sage: K = Cone(random_sublist(J.rays(), 0.5), lattice=J.lattice()) - sage: K_W_star = _rho(K, J).dual() - sage: K_star_W = _rho(K.dual(), J) + sage: K_W_star = _restrict_to_space(K, J.span()).dual() + sage: K_star_W = _restrict_to_space(K.dual(), J.span()) sage: _basically_the_same(K_W_star, K_star_W) True @@ -113,8 +113,8 @@ all parameter combinations:: ....: solid=False, ....: strictly_convex=True) sage: K = Cone(random_sublist(J.rays(), 0.5), lattice=J.lattice()) - sage: K_W_star = _rho(K, J).dual() - sage: K_star_W = _rho(K.dual(), J) + sage: K_W_star = _restrict_to_space(K, J.span()).dual() + sage: K_star_W = _restrict_to_space(K.dual(), J.span()) sage: _basically_the_same(K_W_star, K_star_W) True @@ -125,8 +125,8 @@ all parameter combinations:: ....: solid=True, ....: strictly_convex=True) sage: K = Cone(random_sublist(J.rays(), 0.5), lattice=J.lattice()) - sage: K_W_star = _rho(K, J).dual() - sage: K_star_W = _rho(K.dual(), J) + sage: K_W_star = _restrict_to_space(K, J.span()).dual() + sage: K_star_W = _restrict_to_space(K.dual(), J.span()) sage: _basically_the_same(K_W_star, K_star_W) True