]> gitweb.michael.orlitzky.com - spline3.git/blobdiff - src/Values.hs
Make Main a little more amenable to changes.
[spline3.git] / src / Values.hs
index 070abbbf2554ea5eec5276e5496fe1554fcaf3d3..d7ede8399391b3229a1c7a6d36f04fececd3674b 100644 (file)
@@ -26,9 +26,10 @@ import Test.QuickCheck (Arbitrary(..), Gen, choose, vectorOf)
 import ScaleFactor
 
 
-type Values1D = Array DIM1 Double
-type Values2D = Array DIM2 Double
-type Values3D = Array DIM3 Double
+type Values sh = Array sh Double
+type Values1D = Values DIM1
+type Values2D = Values DIM2
+type Values3D = Values DIM3
 
 
 instance Arbitrary Values3D where
@@ -86,3 +87,8 @@ zoom_shape (sfx, sfy, sfz) sh =
         z' = z * sfz
     in
       (Z :. x' :. y' :. z')
+
+
+drop_z :: DIM3 -> DIM2
+drop_z (Z :. 1 :. y :. x) = (Z :. y :. x)
+drop_z _ = error "can't drop the z-dimension unless its size is 1"