X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Fcone%2Ftests.py;h=1758f8b4749a171165ea574aa87a7389019779bc;hb=ca8899446fdb5c212410beffac677143f0785f5f;hp=b9dc2e064d771de1eb9bb02184a5d4d1df8ea319;hpb=af3e2ce56ad6561c5c9b1b6cf3df22d690550618;p=sage.d.git diff --git a/mjo/cone/tests.py b/mjo/cone/tests.py index b9dc2e0..1758f8b 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 @@ -216,14 +216,14 @@ cone. Check all combinations of parameters:: sage: lyapunov_rank(K) == lyapunov_rank(K.dual()) True -The Lyapunov rank of a cone ``K`` is the dimension of ``LL(K)``. Check -all combinations of parameters:: +The Lyapunov rank of a cone ``K`` is the dimension of +``K.lyapunov_like_basis()``. Check all combinations of parameters:: sage: set_random_seed() sage: K = random_cone(max_ambient_dim=8, ....: strictly_convex=True, ....: solid=True) - sage: lyapunov_rank(K) == len(LL(K)) + sage: lyapunov_rank(K) == len(K.lyapunov_like_basis()) True :: @@ -232,7 +232,7 @@ all combinations of parameters:: sage: K = random_cone(max_ambient_dim=8, ....: strictly_convex=True, ....: solid=False) - sage: lyapunov_rank(K) == len(LL(K)) + sage: lyapunov_rank(K) == len(K.lyapunov_like_basis()) True :: @@ -241,7 +241,7 @@ all combinations of parameters:: sage: K = random_cone(max_ambient_dim=8, ....: strictly_convex=False, ....: solid=True) - sage: lyapunov_rank(K) == len(LL(K)) + sage: lyapunov_rank(K) == len(K.lyapunov_like_basis()) True :: @@ -250,7 +250,7 @@ all combinations of parameters:: sage: K = random_cone(max_ambient_dim=8, ....: strictly_convex=False, ....: solid=False) - sage: lyapunov_rank(K) == len(LL(K)) + sage: lyapunov_rank(K) == len(K.lyapunov_like_basis()) True """