]> git.sesse.net Git - vlc/commitdiff
doc/transforms.py: whrandom is deprecated since python 2.1
authorRafaël Carré <rafael.carre@gmail.com>
Wed, 7 Jul 2010 18:52:24 +0000 (20:52 +0200)
committerRafaël Carré <rafael.carre@gmail.com>
Wed, 7 Jul 2010 18:53:05 +0000 (20:53 +0200)
Only import needed functions

doc/transforms.py

index 531fdd358e727284860a0f697e188daa5f72126e..ac9d5857e6f6251ecc5dc8e7c3e9545fd72173dc 100644 (file)
@@ -3,16 +3,12 @@
 # reference about classical DCT and DFT algorithms.
 
 
-import math
-import cmath
-
-pi = math.pi
-sin = math.sin
-cos = math.cos
-sqrt = math.sqrt
+from random import random
+from math import pi, sin, cos, sqrt
+from cmath import exp
 
 def exp_j (alpha):
-    return cmath.exp (alpha * 1j)
+    return exp (alpha * 1j)
 
 def conjugate (c):
     c = c + 0j
@@ -1067,15 +1063,13 @@ def dump (vector):
        str = str + realstr #+ imagstr
     return "[%s]" % str
 
-import whrandom
-
 def test(N):
     input = vector(N)
     output = vector(N)
     verify = vector(N)
 
     for i in range(N):
-       input[i] = whrandom.random() + 1j * whrandom.random()
+       input[i] = random() + 1j * random()
 
     unscaled_DFT (N, input, output)
     unscaled_DFT (N, input, verify)