]> gitweb.michael.orlitzky.com - spline3.git/blobdiff - src/Values.hs
Update to repa3 (Ben Lippmeier).
[spline3.git] / src / Values.hs
index 8e40212eda252af463b231782b9f424ce4ba48ad..b5dc15a9c6299bb0ec74511a8e561d6c0bdcf09a 100644 (file)
@@ -12,13 +12,13 @@ module Values (
 where
 
 import Data.Array.Repa (
-  Array,
+  Array, U,
   Z(..),
   (:.)(..),
   DIM2,
   DIM3,
   extent,
-  fromList,
+  fromListUnboxed,
   unsafeIndex,
   )
 
@@ -29,9 +29,9 @@ import Test.QuickCheck (Arbitrary(..), Gen, choose, vectorOf)
 import ScaleFactor (ScaleFactor)
 
 
-type Values sh = Array sh Double
-type Values2D = Values DIM2
-type Values3D = Values DIM3
+type Values sh = Array sh Double
+type Values2D  = Values DIM2
+type Values3D  = Values DIM3
 
 
 instance Arbitrary Values3D where
@@ -42,12 +42,12 @@ instance Arbitrary Values3D where
       z_dim <- choose (1, 27)
       elements <- vectorOf (x_dim * y_dim * z_dim) (arbitrary :: Gen Double)
       let new_shape = (Z :. x_dim :. y_dim :. z_dim)
-      let three_d = Data.Array.Repa.fromList new_shape elements
+      let three_d = Data.Array.Repa.fromListUnboxed new_shape elements
       return three_d
 
 
 empty3d :: Values3D
-empty3d = Data.Array.Repa.fromList (Z :. 0 :. 0 :. 0) []
+empty3d = Data.Array.Repa.fromListUnboxed (Z :. 0 :. 0 :. 0) []
 
 
 dims :: Values3D -> (Int, Int, Int)