From: Michael Orlitzky Date: Sun, 4 Nov 2018 05:58:55 +0000 (-0400) Subject: cone/rearrangement.py: use xrange everywhere. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=130412e6e41fd148a9c993bb2f3b2ad70ffe5dae;p=sage.d.git cone/rearrangement.py: use xrange everywhere. --- diff --git a/mjo/cone/rearrangement.py b/mjo/cone/rearrangement.py index b2ccfcb..bdf72eb 100644 --- a/mjo/cone/rearrangement.py +++ b/mjo/cone/rearrangement.py @@ -53,20 +53,20 @@ def rearrangement_cone(p,n): All rearrangement cones are proper:: sage: all( rearrangement_cone(p,n).is_proper() - ....: for n in range(10) - ....: for p in range(n) ) + ....: for n in xrange(10) + ....: for p in xrange(n) ) True The Lyapunov rank of the rearrangement cone of order ``p`` in ``n`` dimensions is ``n`` for ``p == 1`` or ``p == n`` and one otherwise:: sage: all( rearrangement_cone(p,n).lyapunov_rank() == n - ....: for n in range(2, 10) + ....: for n in xrange(2, 10) ....: for p in [1, n-1] ) True sage: all( rearrangement_cone(p,n).lyapunov_rank() == 1 - ....: for n in range(3, 10) - ....: for p in range(2, n-1) ) + ....: for n in xrange(3, 10) + ....: for p in xrange(2, n-1) ) True TESTS: @@ -88,7 +88,7 @@ def rearrangement_cone(p,n): return v V = VectorSpace(QQ, n) - G = V.basis() + [ d(j) for j in range(n) ] + G = V.basis() + [ d(j) for j in xrange(n) ] return Cone(G) @@ -137,8 +137,8 @@ def has_rearrangement_property(v, p): ....: rearrangement_cone(p,n).random_element(), ....: p ....: ) - ....: for n in range(2, 10) - ....: for p in range(1, n-1) + ....: for n in xrange(2, 10) + ....: for p in xrange(1, n-1) ....: ) True