From: Michael Orlitzky Date: Wed, 7 Sep 2011 05:26:41 +0000 (-0400) Subject: Use unsafe versions of index and traverse. X-Git-Tag: 0.0.1~149^2~1 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=c832bb3ac428a0d96759d9c82e9547d3acf4353d;p=spline3.git Use unsafe versions of index and traverse. --- diff --git a/src/Grid.hs b/src/Grid.hs index fcdeb5e..01d73a2 100644 --- a/src/Grid.hs +++ b/src/Grid.hs @@ -156,7 +156,7 @@ zoom :: Grid -> ScaleFactor -> Values3D zoom g scale_factor | xsize == 0 || ysize == 0 || zsize == 0 = empty3d | otherwise = - R.force $ R.traverse arr transExtent (zoom_lookup g scale_factor) + R.force $ R.unsafeTraverse arr transExtent (zoom_lookup g scale_factor) where arr = function_values g (xsize, ysize, zsize) = dims arr diff --git a/src/Values.hs b/src/Values.hs index 8e2b61e..070abbb 100644 --- a/src/Values.hs +++ b/src/Values.hs @@ -12,7 +12,7 @@ import Data.Array.Repa ( DIM3, extent, fromList, - index, + unsafeIndex, reshape, size ) @@ -72,7 +72,7 @@ dims v3d = idx :: Values3D -> Int -> Int -> Int -> Double idx v3d i j k = - index v3d shape + unsafeIndex v3d shape where shape :: DIM3 shape = (Z :. i :. j :. k)