[Scipy-svn] r2302 - in trunk/Lib/integrate: . tests

scipy-svn at scipy.org scipy-svn at scipy.org
Sun Nov 5 16:27:11 CST 2006


Author: stefan
Date: 2006-11-05 16:26:48 -0600 (Sun, 05 Nov 2006)
New Revision: 2302

Modified:
   trunk/Lib/integrate/quadrature.py
   trunk/Lib/integrate/tests/test_quadrature.py
Log:
Fix romb.


Modified: trunk/Lib/integrate/quadrature.py
===================================================================
--- trunk/Lib/integrate/quadrature.py	2006-11-03 16:30:58 UTC (rev 2301)
+++ trunk/Lib/integrate/quadrature.py	2006-11-05 22:26:48 UTC (rev 2302)
@@ -273,7 +273,7 @@
     The number of samples must be 1 + a non-negative power of two: N=2**k + 1
 
     See also:
-    
+
       quad - adaptive quadrature using QUADPACK
       romberg - adaptive Romberg quadrature
       quadrature - adaptive Gaussian quadrature
@@ -306,7 +306,7 @@
     start = stop = step = Ninterv
     for i in range(2,k+1):
         start >>= 1
-        slice_R = tupleset(slice_R, slice(start,stop,step))
+        slice_R = tupleset(slice_R, axis, slice(start,stop,step))
         step >>= 1
         R[(i,1)] = 0.5*(R[(i-1,1)] + h*add.reduce(y[slice_R],axis))
         for j in range(2,i+1):

Modified: trunk/Lib/integrate/tests/test_quadrature.py
===================================================================
--- trunk/Lib/integrate/tests/test_quadrature.py	2006-11-03 16:30:58 UTC (rev 2301)
+++ trunk/Lib/integrate/tests/test_quadrature.py	2006-11-05 22:26:48 UTC (rev 2302)
@@ -4,7 +4,7 @@
 from numpy.testing import *
 
 set_package_path()
-from scipy.integrate import quadrature, romberg
+from scipy.integrate import quadrature, romberg, romb
 restore_path()
 
 class test_quadrature(ScipyTestCase):
@@ -27,5 +27,8 @@
         table_val = 0.30614353532540296487
         assert_almost_equal(val, table_val, decimal=7)
 
+    def check_romb(self):
+        assert_equal(romb(numpy.arange(17)),128)
+
 if __name__ == "__main__":
     ScipyTest().run()



More information about the Scipy-svn mailing list