]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
Commit the good (?) version of cone.py.
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 1 Jun 2015 00:33:11 +0000 (20:33 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 1 Jun 2015 00:33:11 +0000 (20:33 -0400)
mjo/cone/cone.py

index 81698e467c603df3e57cb764c256a2e082df5ec6..3a1e190cb2ebe41f57810f04726f8123294c55cd 100644 (file)
@@ -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))