[python-dtcwt] 175/497: opencl.transform2d: use slice notation

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Jul 21 18:06:01 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/sid
in repository python-dtcwt.

commit eba627e9901b5727e1964d14189e62c732476c4a
Author: Rich Wareham <rjw57 at cam.ac.uk>
Date:   Sat Nov 9 13:59:41 2013 +0000

    opencl.transform2d: use slice notation
    
    The arbitrary A[:,[1,2,3]] style of indexing doesn't work for OpenCL
    arrays. Replace it with a slice-notation based version.
---
 dtcwt/opencl/transform2d.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/dtcwt/opencl/transform2d.py b/dtcwt/opencl/transform2d.py
index 19066f8..b3f56bb 100644
--- a/dtcwt/opencl/transform2d.py
+++ b/dtcwt/opencl/transform2d.py
@@ -100,9 +100,9 @@ def dtwavexfm2(X, nlevels=3, biort=DEFAULT_BIORT, qshift=DEFAULT_QSHIFT, include
         # Do odd top-level filters on rows.
         LoLo = axis_convolve(Lo,h0o,axis=1)
         Yh[0] = np.zeros((LoLo.shape[0] >> 1, LoLo.shape[1] >> 1, 6), dtype=complex_dtype)
-        Yh[0][:,:,[0, 5]] = q2c(to_array(axis_convolve(Hi,h0o,axis=1,queue=queue)))     # Horizontal pair
-        Yh[0][:,:,[2, 3]] = q2c(to_array(axis_convolve(Lo,h1o,axis=1,queue=queue)))     # Vertical pair
-        Yh[0][:,:,[1, 4]] = q2c(to_array(axis_convolve(Hi,h1o,axis=1,queue=queue)))     # Diagonal pair
+        Yh[0][:,:,0:6:5] = q2c(to_array(axis_convolve(Hi,h0o,axis=1,queue=queue)))     # Horizontal pair
+        Yh[0][:,:,2:4:1] = q2c(to_array(axis_convolve(Lo,h1o,axis=1,queue=queue)))     # Vertical pair
+        Yh[0][:,:,1:5:3] = q2c(to_array(axis_convolve(Hi,h1o,axis=1,queue=queue)))     # Diagonal pair
 
         if include_scale:
             Yscale[0] = to_array(LoLo)
@@ -127,9 +127,9 @@ def dtwavexfm2(X, nlevels=3, biort=DEFAULT_BIORT, qshift=DEFAULT_QSHIFT, include
         LoLo = axis_convolve_dfilter(Lo,h0b,axis=1,queue=queue)
 
         Yh[level] = np.zeros((LoLo.shape[0]>>1, LoLo.shape[1]>>1, 6), dtype=complex_dtype)
-        Yh[level][:,:,[0, 5]] = q2c(to_array(axis_convolve_dfilter(Hi,h0b,axis=1,queue=queue)))  # Horizontal
-        Yh[level][:,:,[2, 3]] = q2c(to_array(axis_convolve_dfilter(Lo,h1b,axis=1,queue=queue)))  # Vertical
-        Yh[level][:,:,[1, 4]] = q2c(to_array(axis_convolve_dfilter(Hi,h1b,axis=1,queue=queue)))  # Diagonal   
+        Yh[level][:,:,0:6:5] = q2c(to_array(axis_convolve_dfilter(Hi,h0b,axis=1,queue=queue)))  # Horizontal
+        Yh[level][:,:,2:4:1] = q2c(to_array(axis_convolve_dfilter(Lo,h1b,axis=1,queue=queue)))  # Vertical
+        Yh[level][:,:,1:5:3] = q2c(to_array(axis_convolve_dfilter(Hi,h1b,axis=1,queue=queue)))  # Diagonal   
 
         if include_scale:
             Yscale[level] = to_array(LoLo)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-dtcwt.git



More information about the debian-science-commits mailing list