X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FValues.hs;h=d7ede8399391b3229a1c7a6d36f04fececd3674b;hb=f877af8565db22a047214827d44c4435f96385d5;hp=070abbbf2554ea5eec5276e5496fe1554fcaf3d3;hpb=3b111f8df1bde25f32f3d5378844cbcf34404015;p=spline3.git diff --git a/src/Values.hs b/src/Values.hs index 070abbb..d7ede83 100644 --- a/src/Values.hs +++ b/src/Values.hs @@ -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"