]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
cone/permutation_invariant.py: add test for the nonnegative orthant.
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 4 Nov 2018 04:53:32 +0000 (00:53 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 4 Nov 2018 04:53:32 +0000 (00:53 -0400)
mjo/cone/permutation_invariant.py

index d87ace2be9a034264b497586130bc6a3492e9be2..faa39f76fbe9072c54f1ff29cebb563d1e8524cb 100644 (file)
@@ -50,16 +50,26 @@ def is_permutation_invariant(K):
 
     SETUP::
 
-        sage: from mjo.cone.rearrangement import rearrangement_cone
+        sage: from mjo.cone.nonnegative_orthant import nonnegative_orthant
         sage: from mjo.cone.permutation_invariant import is_permutation_invariant
+        sage: from mjo.cone.rearrangement import rearrangement_cone
+
+    EXAMPLES:
 
-    EXAMPLES::
+    The rearrangement cone is permutation-invariant::
 
         sage: all( is_permutation_invariant(rearrangement_cone(p,n))
         ....:               for n in range(3, 6)
         ....:               for p in range(1, n) )
         True
 
+    As is the nonnegative orthant::
+
+        sage: set_random_seed()
+        sage: K = nonnegative_orthant(ZZ.random_element(5))
+        sage: is_permutation_invariant(K)
+        True
+
     """
     # We'll need this to turn rays into vectors so that we can permute
     # them with permutation matrices.