From: Michael Orlitzky Date: Sun, 19 Aug 2012 17:59:36 +0000 (-0400) Subject: Fix MRI.hs for repa-3.2. X-Git-Tag: 0.0.1~48 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=1ea61681483c8402faf572c8c853ba086b622ffe;p=spline3.git Fix MRI.hs for repa-3.2. --- diff --git a/src/MRI.hs b/src/MRI.hs index d741091..5cca1ae 100644 --- a/src/MRI.hs +++ b/src/MRI.hs @@ -88,7 +88,7 @@ flip16 xx = {-# INLINE swap_bytes #-} -swap_bytes :: (Shape sh, Repr r Word16) => Array r sh Word16 +swap_bytes :: (Shape sh, Source r Word16) => Array r sh Word16 -> Array D sh Word16 swap_bytes = R.map flip16 @@ -105,13 +105,13 @@ round_array = R.map round -flip_y :: Repr r Word16 => Array r DIM3 Word16 -> Array D DIM3 Word16 +flip_y :: Source r Word16 => Array r DIM3 Word16 -> Array D DIM3 Word16 flip_y arr = R.unsafeTraverse arr id (\get (Z :. z :. y :. x) -> get (Z :. z :. (mri_height - 1) - y :. x)) -flip_x :: Repr r Word16 => Array r DIM3 Word16 -> Array D DIM3 Word16 +flip_x :: Source r Word16 => Array r DIM3 Word16 -> Array D DIM3 Word16 flip_x arr = R.unsafeTraverse arr id (\get (Z :. z :. y :. x) -> @@ -148,7 +148,7 @@ values_to_colors arr = b' = truncate (b * 255) -z_slice :: (R.Unbox a, Repr r a) => Int -> Array r DIM3 a -> Array D DIM2 a +z_slice :: (R.Unbox a, Source r a) => Int -> Array r DIM3 a -> Array D DIM2 a z_slice n arr = slice arr (Any :. n :. All :. All)