]> gitweb.michael.orlitzky.com - spline3.git/blobdiff - src/Tetrahedron.hs
Add comments to the effect that some functions are only used in tests.
[spline3.git] / src / Tetrahedron.hs
index e71151a1e6a1d370a1057010415976a332cc15fe..4c7abed0fe78e282ec1096c410cae41c15300129 100644 (file)
@@ -1,3 +1,4 @@
+{-# LANGUAGE BangPatterns #-}
 module Tetrahedron (
   Tetrahedron(..),
   b0, -- Cube test
@@ -33,11 +34,11 @@ import ThreeDimensional (ThreeDimensional(..))
 
 data Tetrahedron =
   Tetrahedron { function_values :: FunctionValues,
-                v0 :: Point,
-                v1 :: Point,
-                v2 :: Point,
-                v3 :: Point,
-                precomputed_volume :: Double
+                v0 :: !Point,
+                v1 :: !Point,
+                v2 :: !Point,
+                v3 :: !Point,
+                precomputed_volume :: !Double
               }
     deriving (Eq)
 
@@ -70,6 +71,7 @@ instance ThreeDimensional Tetrahedron where
     center (Tetrahedron _ v0' v1' v2' v3' _) =
         (v0' + v1' + v2' + v3') `scale` (1/4)
 
+    -- contains_point is only used in tests.
     contains_point t p0 =
       b0_unscaled `nearly_ge` 0 &&
       b1_unscaled `nearly_ge` 0 &&
@@ -142,7 +144,7 @@ beta t i j k l
 --   Zeilfelder, pp. 84-86. If incorrect indices are supplied, the
 --   function will simply error.
 c :: Tetrahedron -> Int -> Int -> Int -> Int -> Double
-c t i j k l =
+c !t !i !j !k !l =
   coefficient i j k l
   where
     fvs = function_values t