From db71f895bcdf4550bc4212d0e2fae41c8de22d6a Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 31 May 2015 20:33:11 -0400 Subject: [PATCH] Commit the good (?) version of cone.py. --- mjo/cone/cone.py | 49 ++++++++++++++++++------------------------------ 1 file changed, 18 insertions(+), 31 deletions(-) diff --git a/mjo/cone/cone.py b/mjo/cone/cone.py index 81698e4..3a1e190 100644 --- a/mjo/cone/cone.py +++ b/mjo/cone/cone.py @@ -204,6 +204,23 @@ def LL(K): sage: sum(map(abs, l)) 0 + Try the formula in my paper:: + + sage: K = random_cone(max_dim=15, max_rays=25) + sage: actual = lyapunov_rank(K) + sage: K_S = project_span(K) + sage: J_T1 = project_span(K, K_S.dual()) + sage: J_T2 = project_span(K_S.dual()).dual() + sage: J_T2 = Cone(J_T2.rays(), lattice=J_T1.lattice()) + sage: J_T1 == J_T2 + True + sage: J_T = J_T1 + sage: l = K.linear_subspace().dimension() + sage: codim = K.lattice_dim() - K.dim() + sage: expected = lyapunov_rank(J_T) + K.dim()*(l + codim) + codim**2 + sage: actual == expected + True + """ V = K.lattice().vector_space() @@ -259,7 +276,7 @@ def lyapunov_rank(K): An integer representing the Lyapunov rank of the cone. If the dimension of the ambient vector space is `n`, then the Lyapunov rank will be between `1` and `n` inclusive; however a rank of `n-1` is - not possible for any cone. + not possible (see the first reference). .. note:: @@ -285,9 +302,6 @@ def lyapunov_rank(K): cone and Lyapunov-like transformations, Mathematical Programming, 147 (2014) 155-170. - .. [Orlitzky/Gowda] M. Orlitzky and M. S. Gowda. The Lyapunov Rank of an - Improper Cone. Work in-progress. - .. [Rudolf et al.] G. Rudolf, N. Noyan, D. Papp, and F. Alizadeh, Bilinear optimality constraints for the cone of positive polynomials, Mathematical Programming, Series B, 129 (2011) 5-31. @@ -376,32 +390,5 @@ def lyapunov_rank(K): sage: b == n-1 False - In fact [Orlitzky/Gowda]_, no closed convex polyhedral cone can have - Lyapunov rank `n-1` in `n` dimensions:: - - sage: K = random_cone(max_dim=10, max_rays=16) - sage: b = lyapunov_rank(K) - sage: n = K.lattice_dim() - sage: b == n-1 - False - - The calculation of the Lyapunov rank of an improper cone can be - reduced to that of a proper cone [Orlitzky/Gowda]_:: - - sage: K = random_cone(max_dim=15, max_rays=25) - sage: actual = lyapunov_rank(K) - sage: K_S = project_span(K) - sage: J_T1 = project_span(K_S.dual()).dual() - sage: J_T2 = project_span(K, K_S.dual()) - sage: J_T2 = Cone(J_T2.rays(), lattice=J_T1.lattice()) - sage: J_T1 == J_T2 - True - sage: J_T = J_T1 - sage: l = K.linear_subspace().dimension() - sage: codim = K.lattice_dim() - K.dim() - sage: expected = lyapunov_rank(J_T) + K.dim()*(l + codim) + codim**2 - sage: actual == expected - True - """ return len(LL(K)) -- 2.44.2