From dbef443b13d185940629eb870fc93f55cb5a70a3 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Thu, 8 Oct 2015 15:53:32 -0400 Subject: [PATCH] Rename LL() to lyapunov_like_basis(). --- mjo/cone/cone.py | 24 +++++++++++++----------- mjo/cone/tests.py | 12 ++++++------ 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/mjo/cone/cone.py b/mjo/cone/cone.py index 6ad7c52..cd835a7 100644 --- a/mjo/cone/cone.py +++ b/mjo/cone/cone.py @@ -76,7 +76,7 @@ def _basically_the_same(K1, K2): if K1.is_strictly_convex() != K2.is_strictly_convex(): return False - if len(K1.LL()) != len(K2.LL()): + if len(K1.lyapunov_like_basis()) != len(K2.lyapunov_like_basis()): return False C_of_K1 = K1.discrete_complementarity_set() @@ -414,11 +414,12 @@ def lyapunov_rank(K): sage: actual == expected True - The Lyapunov rank of any cone is just the dimension of ``K.LL()``:: + The Lyapunov rank of any cone is just the dimension of + ``K.lyapunov_like_basis()``:: sage: set_random_seed() sage: K = random_cone(max_ambient_dim=8) - sage: lyapunov_rank(K) == len(K.LL()) + sage: lyapunov_rank(K) == len(K.lyapunov_like_basis()) True We can make an imperfect cone perfect by adding a slack variable @@ -456,7 +457,7 @@ def lyapunov_rank(K): # Non-pointed reduction lemma. beta += l * m - beta += len(K.LL()) + beta += len(K.lyapunov_like_basis()) return beta @@ -514,10 +515,11 @@ def is_lyapunov_like(L,K): sage: is_lyapunov_like(L,K) True - Everything in ``K.LL()`` should be Lyapunov-like on ``K``:: + Everything in ``K.lyapunov_like_basis()`` should be Lyapunov-like + on ``K``:: sage: K = random_cone(min_ambient_dim = 1, max_rays = 5) - sage: all([is_lyapunov_like(L,K) for L in K.LL()]) + sage: all([ is_lyapunov_like(L,K) for L in K.lyapunov_like_basis() ]) True """ @@ -713,9 +715,9 @@ def Z_transformations(K): sage: K = Cone([(1,0),(-1,0),(0,1),(0,-1)]) sage: K.is_full_space() True - sage: llvs = span([ vector(l.list()) for l in K.LL() ]) - sage: zvs = span([ vector(z.list()) for z in Z_transformations(K) ]) - sage: zvs == llvs + sage: lls = span([ vector(l.list()) for l in K.lyapunov_like_basis() ]) + sage: zs = span([ vector(z.list()) for z in Z_transformations(K) ]) + sage: zs == lls True TESTS: @@ -734,9 +736,9 @@ def Z_transformations(K): sage: set_random_seed() sage: K = random_cone(min_ambient_dim = 1, max_ambient_dim = 6) - sage: llvs = span([ vector(l.list()) for l in K.LL() ]) + sage: lls = span([ vector(l.list()) for l in K.lyapunov_like_basis() ]) sage: z_cone = Cone([ z.list() for z in Z_transformations(K) ]) - sage: z_cone.linear_subspace() == llvs + sage: z_cone.linear_subspace() == lls True """ diff --git a/mjo/cone/tests.py b/mjo/cone/tests.py index 0df9e32..1758f8b 100644 --- a/mjo/cone/tests.py +++ b/mjo/cone/tests.py @@ -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(K.LL()) + 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(K.LL()) + 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(K.LL()) + 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(K.LL()) + sage: lyapunov_rank(K) == len(K.lyapunov_like_basis()) True """ -- 2.44.2