| 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.