+{-# 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.
Positive(..),
Property,
choose)
-import Assertions (assertAlmostEqual, assertClose, assertTrue)
+import Assertions (assertAlmostEqual, assertTrue)
import Comparisons ((~=))
import Cube (Cube(Cube),
find_containing_tetrahedron,
-- 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"
test_trilinear_f0_t0_v3 :: Assertion
test_trilinear_f0_t0_v3 =
- assertClose "v3 is correct" (v3 t) (0.5, 1.5, 1.5)
+ assertEqual "v3 is correct" (v3 t) (0.5, 1.5, 1.5)
test_trilinear_reproduced :: Assertion