+{-# LANGUAGE BangPatterns #-}
-- | The Grid module just contains the Grid type and two constructors
-- for it. We hide the main Grid constructor because we don't want
-- to allow instantiation of a grid with h <= 0.
where
import qualified Data.Array.Repa as R
-import Test.HUnit
+import Test.HUnit (Assertion, assertEqual)
import Test.Framework (Test, testGroup)
import Test.Framework.Providers.HUnit (testCase)
import Test.Framework.Providers.QuickCheck2 (testProperty)
Positive(..),
Property,
choose)
-import Assertions
-import Comparisons
+import Assertions (assertAlmostEqual, assertClose, assertTrue)
+import Comparisons ((~=))
import Cube (Cube(Cube),
find_containing_tetrahedron,
tetrahedra,
tetrahedron)
-import Examples
-import FunctionValues
+import Examples (trilinear, trilinear9x9x9, zeros, naturals_1d)
+import FunctionValues (make_values, value_at)
import Point (Point)
-import ScaleFactor
+import ScaleFactor (ScaleFactor)
import Tetrahedron (Tetrahedron, c, polynomial, v0, v1, v2, v3)
-import ThreeDimensional
+import ThreeDimensional (ThreeDimensional(..))
import Values (Values3D, dims, empty3d, zoom_shape)
-- centered on that position. If there is no cube there (i.e. the
-- position is outside of the grid), it will throw an error.
cube_at :: Grid -> Int -> Int -> Int -> Cube
-cube_at g i j k
+cube_at !g !i !j !k
| i < 0 = error "i < 0 in cube_at"
| i >= xsize = error "i >= xsize in cube_at"
| j < 0 = error "j < 0 in cube_at"