[Scipy-svn] r6923 - trunk/scipy/ndimage

scipy-svn@scip... scipy-svn@scip...
Sat Nov 20 02:02:42 CST 2010


Author: warren.weckesser
Date: 2010-11-20 02:02:42 -0600 (Sat, 20 Nov 2010)
New Revision: 6923

Modified:
   trunk/scipy/ndimage/filters.py
Log:
Use sd2 computed outside the loop instead of dividing by sd twice.

Modified: trunk/scipy/ndimage/filters.py
===================================================================
--- trunk/scipy/ndimage/filters.py	2010-11-20 07:52:46 UTC (rev 6922)
+++ trunk/scipy/ndimage/filters.py	2010-11-20 08:02:42 UTC (rev 6923)
@@ -214,7 +214,7 @@
         sd2 = sd * sd
         for ii in range(1, lw + 1):
             x = float(ii)
-            tmp = (3.0 - x * x / sd) * x * weights[lw + ii] / sd / sd
+            tmp = (3.0 - x * x / sd) * x * weights[lw + ii] / sd2
             weights[lw + ii] = -tmp
             weights[lw - ii] = tmp
     return correlate1d(input, weights, axis, output, mode, cval, 0)



More information about the Scipy-svn mailing list