]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
matrix_vector.py: use xrange everywhere.
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 4 Nov 2018 06:12:22 +0000 (01:12 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 4 Nov 2018 06:12:22 +0000 (01:12 -0500)
mjo/matrix_vector.py

index 055e4aa9d62dd40b6bf082b19bfb0aa2f199444d..2a0e9e8d54a8dd45dd473a04780a63823e5030cd 100644 (file)
@@ -33,7 +33,7 @@ def isomorphism(matrix_space):
 
         sage: M = MatrixSpace(QQ,4,4)
         sage: (p, p_inv) = isomorphism(M)
-        sage: m = M(range(0,16))
+        sage: m = M(xrange(16))
         sage: p_inv(p(m)) == m
         True
 
@@ -148,8 +148,8 @@ def matrix_of_transformation(T, V):
             return L(x)
 
     entries = []
-    for j in range(0,n):
-        for i in range(0,n):
+    for j in xrange(n):
+        for i in xrange(n):
             entry = inner_product(apply(T,B[i]), B[j])
             entries.append(entry)