dims,
empty3d,
idx,
- zoom_shape
- )
+ zoom_shape )
where
import Data.Array.Repa (
- Array,
- Z(..),
- (:.)(..),
+ Array, U,
+ Z( Z ),
+ (:.)( (:.) ),
DIM2,
DIM3,
extent,
- fromList,
- unsafeIndex,
- )
+ fromListUnboxed,
+ unsafeIndex )
-import System.FilePath ()
-import Test.QuickCheck (Arbitrary(..), Gen, choose, vectorOf)
+import ScaleFactor ( ScaleFactor )
-import ScaleFactor (ScaleFactor)
-
-
-type Values sh = Array sh Double
-type Values2D = Values DIM2
-type Values3D = Values DIM3
-
-
-instance Arbitrary Values3D where
- arbitrary = do
- -- I declare not to care about empty lists.
- x_dim <- choose (1, 27)
- y_dim <- choose (1, 27)
- 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
- return three_d
+type Values sh = Array U sh Double
+type Values2D = Values DIM2
+type Values3D = Values DIM3
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)