コード例 #1
0
 def testPyVsCyOnesCy64(self):
     """test python and cython, double"""
     tf = 3
     nc = 2
     data = sp.ones((20, nc), dtype=sp.float64)
     filt = sp.ones((tf, nc), dtype=sp.float64)
     hist = sp.ones((tf - 1, nc), dtype=sp.float64)
     fopy, hopy = _mcfilter_hist_py(data, filt, hist)
     focy, hocy = _mcfilter_hist_cy64(data, filt, hist)
     assert_almost_equal(fopy, focy)
コード例 #2
0
 def testPyVsCyOnesCy64(self):
     """test python and cython, double"""
     tf = 3
     nc = 2
     data = sp.ones((20, nc), dtype=sp.float64)
     filt = sp.ones((tf, nc), dtype=sp.float64)
     hist = sp.ones((tf - 1, nc), dtype=sp.float64)
     fopy, hopy = _mcfilter_hist_py(data, filt, hist)
     focy, hocy = _mcfilter_hist_cy64(data, filt, hist)
     assert_almost_equal(fopy, focy)
コード例 #3
0
 def testStepsCy64(self):
     tf = 3
     nc = 2
     data = sp.vstack([sp.concatenate([sp.arange(1, 4)] * 5)] * 2).T.astype(
         sp.float64)
     filt = sp.ones((tf, nc), dtype=sp.float64) / float(tf)
     hist_py = sp.ones((tf - 1, nc), dtype=sp.float64)
     hist_cy = sp.ones((tf - 1, nc), dtype=sp.float64)
     fopy, hopy = _mcfilter_hist_py(data, filt, hist_py)
     focy, hocy = _mcfilter_hist_cy64(data, filt, hist_cy)
     assert_almost_equal(fopy, focy)
コード例 #4
0
 def testPyVsCyRandnCy64(self):
     """test python and cython"""
     tf = 3
     nc = 2
     data = sp.randn(20, nc).astype(sp.float64)
     filt = sp.ones((tf, nc), dtype=sp.float64)
     hist_py = sp.ones((tf - 1, nc), dtype=sp.float64)
     hist_cy = sp.ones((tf - 1, nc), dtype=sp.float64)
     fopy, hopy = _mcfilter_hist_py(data, filt, hist_py)
     focy, hocy = _mcfilter_hist_cy64(data, filt, hist_cy)
     assert_almost_equal(fopy, focy)
コード例 #5
0
 def testStepsCy64(self):
     tf = 3
     nc = 2
     data = sp.vstack([sp.concatenate(
         [sp.arange(1, 4)] * 5)] * 2).T.astype(sp.float64)
     filt = sp.ones((tf, nc), dtype=sp.float64) / float(tf)
     hist_py = sp.ones((tf - 1, nc), dtype=sp.float64)
     hist_cy = sp.ones((tf - 1, nc), dtype=sp.float64)
     fopy, hopy = _mcfilter_hist_py(data, filt, hist_py)
     focy, hocy = _mcfilter_hist_cy64(data, filt, hist_cy)
     assert_almost_equal(fopy, focy)
コード例 #6
0
 def testPyVsCyRandnCy64(self):
     """test python and cython"""
     tf = 3
     nc = 2
     data = sp.randn(20, nc).astype(sp.float64)
     filt = sp.ones((tf, nc), dtype=sp.float64)
     hist_py = sp.ones((tf - 1, nc), dtype=sp.float64)
     hist_cy = sp.ones((tf - 1, nc), dtype=sp.float64)
     fopy, hopy = _mcfilter_hist_py(data, filt, hist_py)
     focy, hocy = _mcfilter_hist_cy64(data, filt, hist_cy)
     assert_almost_equal(fopy, focy)