From: Michael Orlitzky Date: Sat, 7 May 2011 01:10:56 +0000 (-0400) Subject: Remove some dead code from the Cube module. X-Git-Tag: 0.0.1~328 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=1d2e0c4c6e5d766bd3ac6834d9dec298679f7c31;p=spline3.git Remove some dead code from the Cube module. --- diff --git a/src/Cube.hs b/src/Cube.hs index 78c5ec2..8d978f7 100644 --- a/src/Cube.hs +++ b/src/Cube.hs @@ -107,53 +107,6 @@ instance ThreeDimensional Cube where | otherwise = True --- instance Num Cube where --- (Cube g1 i1 j1 k1 d1) + (Cube _ i2 j2 k2 d2) = --- Cube g1 (i1 + i2) (j1 + j2) (k1 + k2) (d1 + d2) - --- (Cube g1 i1 j1 k1 d1) - (Cube _ i2 j2 k2 d2) = --- Cube g1 (i1 - i2) (j1 - j2) (k1 - k2) (d1 - d2) - --- (Cube g1 i1 j1 k1 d1) * (Cube _ i2 j2 k2 d2) = --- Cube g1 (i1 * i2) (j1 * j2) (k1 * k2) (d1 * d2) - --- abs (Cube g1 i1 j1 k1 d1) = --- Cube g1 (abs i1) (abs j1) (abs k1) (abs d1) - --- signum (Cube g1 i1 j1 k1 d1) = --- Cube g1 (signum i1) (signum j1) (signum k1) (signum d1) - --- fromInteger x = empty_cube { datum = (fromIntegral x) } - --- instance Fractional Cube where --- (Cube g1 i1 j1 k1 d1) / (Cube _ _ _ _ d2) = --- Cube g1 i1 j1 k1 (d1 / d2) - --- recip (Cube g1 i1 j1 k1 d1) = --- Cube g1 i1 j1 k1 (recip d1) - --- fromRational q = empty_cube { datum = fromRational q } - - - --- | Return the cube corresponding to the grid point i,j,k. The list --- of cubes is stored as [z][y][x] but we'll be requesting it by --- [x][y][z] so we flip the indices in the last line. --- cube_at :: Grid -> Int -> Int -> Int -> Cube --- cube_at g i' j' k' --- | i' >= length (function_values g) = Cube g i' j' k' 0 --- | i' < 0 = Cube g i' j' k' 0 --- | j' >= length ((function_values g) !! i') = Cube g i' j' k' 0 --- | j' < 0 = Cube g i' j' k' 0 --- | k' >= length (((function_values g) !! i') !! j') = Cube g i' j' k' 0 --- | k' < 0 = Cube g i' j' k' 0 --- | otherwise = --- (((cubes g) !! k') !! j') !! i' - - - - - -- Face stuff.