]> gitweb.michael.orlitzky.com - sage.d.git/blobdiff - mjo/cone/cone.py
Add restrict_to_subspace function and use it to test the sage lyapunov_rank().
[sage.d.git] / mjo / cone / cone.py
index 8f8f0d21375b00d2c9e11c1c3b725f3f3d9ea787..1ab6b97c128cde3d1e176032cf0d90f601057166 100644 (file)
@@ -301,6 +301,13 @@ def Z_transformation_gens(K):
         sage: z_cone.linear_subspace() == lls
         True
 
+    And thus, the lineality of Z is the Lyapunov rank::
+
+        sage: set_random_seed()
+        sage: K = random_cone(min_ambient_dim = 1, max_ambient_dim = 6)
+        sage: z_cone  = Cone([ z.list() for z in Z_transformation_gens(K) ])
+        sage: z_cone.lineality() == K.lyapunov_rank()
+        True
     """
     # Matrices are not vectors in Sage, so we have to convert them
     # to vectors explicitly before we can find a basis. We need these