]> gitweb.michael.orlitzky.com - spline3.git/blobdiff - src/Tetrahedron.hs
src/{Cube,Tetrahedron}.hs: disable incomplete pattern warnings via pragmas.
[spline3.git] / src / Tetrahedron.hs
index e63f96b7d1bc750e4c18c08888a5bf95ecc2f049..09b042d9c27e6d7d2611508082fdabe2136e0519 100644 (file)
@@ -1,3 +1,7 @@
+-- The local "coefficient" function defined within the "c" function
+-- pattern matches on a bunch of integers, but doesn't handle the
+-- "otherwise" case for performance reasons.
+{-# OPTIONS_GHC -Wno-incomplete-patterns #-}
 {-# LANGUAGE BangPatterns #-}
 
 module Tetrahedron (
@@ -19,7 +23,7 @@ import qualified Data.Vector as V ( sum )
 import Test.Tasty ( TestTree, testGroup )
 import Test.Tasty.HUnit ( Assertion, assertEqual, testCase )
 import Test.Tasty.QuickCheck (
-  Arbitrary(..),
+  Arbitrary( arbitrary ),
   Gen,
   Property,
   (==>),
@@ -28,7 +32,7 @@ import Test.Tasty.QuickCheck (
 import Comparisons ( (~=) )
 import FunctionValues ( FunctionValues(..), empty_values )
 import Misc ( factorial )
-import Point ( Point(..), scale )
+import Point ( Point(Point), scale )
 import RealFunction ( RealFunction, cmult, fexp )
 
 data Tetrahedron =
@@ -107,7 +111,7 @@ beta t i j k l =
   coefficient `cmult` (b0_term * b1_term * b2_term * b3_term)
   where
     denominator = (factorial i)*(factorial j)*(factorial k)*(factorial l)
-    coefficient = 6 / (fromIntegral denominator)
+    coefficient = (6 / (fromIntegral denominator)) :: Double
     b0_term = (b0 t) `fexp` i
     b1_term = (b1 t) `fexp` j
     b2_term = (b2 t) `fexp` k