]> gitweb.michael.orlitzky.com - sage.d.git/blobdiff - mjo/orthogonal_polynomials.py
eja: undo overzealous hack in _all2list; the bug was elsewhere.
[sage.d.git] / mjo / orthogonal_polynomials.py
index 7544f65c048c72662ff72c40bbcb1197a98382a7..15c695611fb3e287c357075f45e55eeddf550f7f 100644 (file)
@@ -79,7 +79,7 @@ def legendre_p(n, x, a = -1, b = 1):
         ....:     return sum( inner_product(v, b)*b/norm(b)**2
         ....:                 for b in basis)
         sage: f = sin(x)
-        sage: legendre_basis = [ legendre_p(k, x, a, b) for k in xrange(4) ]
+        sage: legendre_basis = [ legendre_p(k, x, a, b) for k in range(4) ]
         sage: proj = project(legendre_basis, f)
         sage: proj.simplify_trig()
         5/2*(7*(pi^2 - 15)*x^3 - 3*(pi^4 - 21*pi^2)*x)/pi^6
@@ -89,7 +89,7 @@ def legendre_p(n, x, a = -1, b = 1):
     We should agree with Maxima for all `n`::
 
         sage: eq = lambda k: bool(legendre_p(k,x) == legendre_P(k,x))
-        sage: all( eq(k) for k in xrange(20) ) # long time
+        sage: all( eq(k) for k in range(20) ) # long time
         True
 
     We can evaluate the result of the zeroth polynomial::
@@ -193,6 +193,6 @@ def legendre_p(n, x, a = -1, b = 1):
 
     # From Abramowitz & Stegun, (22.3.2) with alpha = beta = 0.
     # Also massaged to support finite field elements.
-    P = sum( c(m)*g(m) for m in xrange(n+1) )/(2**n)
+    P = sum( c(m)*g(m) for m in range(n+1) )/(2**n)
 
     return P