From: Michael Orlitzky Date: Sun, 4 Nov 2018 04:53:32 +0000 (-0400) Subject: cone/permutation_invariant.py: add test for the nonnegative orthant. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=2ae468e06b4874fde9cf80981dc41091322d3156;p=sage.d.git cone/permutation_invariant.py: add test for the nonnegative orthant. --- diff --git a/mjo/cone/permutation_invariant.py b/mjo/cone/permutation_invariant.py index d87ace2..faa39f7 100644 --- a/mjo/cone/permutation_invariant.py +++ b/mjo/cone/permutation_invariant.py @@ -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.