]> gitweb.michael.orlitzky.com - spline3.git/blobdiff - src/Grid.hs
Remove the Point.distance function and associated assertion. We only need the dot...
[spline3.git] / src / Grid.hs
index ca66437a6bb13b73d591b68d1b16d3ead8d60c89..d5553b426fc6c18c38438afec5d3039ee1c2a4cc 100644 (file)
@@ -1,3 +1,4 @@
+{-# 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.
@@ -21,7 +22,7 @@ import Test.QuickCheck ((==>),
                         Positive(..),
                         Property,
                         choose)
-import Assertions (assertAlmostEqual, assertClose, assertTrue)
+import Assertions (assertAlmostEqual, assertTrue)
 import Comparisons ((~=))
 import Cube (Cube(Cube),
              find_containing_tetrahedron,
@@ -65,7 +66,7 @@ make_grid grid_size values
 --   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"
@@ -281,7 +282,7 @@ trilinear_c0_t0_tests =
 
     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