+-- The "tetrahedron" function pattern matches on the integers zero
+-- through twenty-three, but doesn't handle the "otherwise" case, for
+-- performance reasons.
+{-# OPTIONS_GHC -Wno-incomplete-patterns #-}
+
module Cube (
Cube(..),
cube_properties,
singleton,
snoc,
unsafeIndex)
-import Prelude hiding ( LT )
+import Prelude(
+ Bool,
+ Double,
+ Int,
+ Eq( (==) ),
+ Fractional( (/) ),
+ Maybe,
+ Num( (+), (-), (*) ),
+ Ord( (>=), (<=) ),
+ Show( show ),
+ ($),
+ (.),
+ (&&),
+ (++),
+ abs,
+ all,
+ and,
+ fromIntegral,
+ head,
+ map,
+ otherwise,
+ return,
+ tail )
import Test.Tasty ( TestTree, testGroup )
import Test.Tasty.QuickCheck (
- Arbitrary(..),
+ Arbitrary( arbitrary ),
Gen,
- Positive(..),
+ Positive( Positive ),
choose,
testProperty )
import Cardinal (
- Cardinal(..),
+ Cardinal(F, B, L, R, D, T, FL, FR, FD, FT,
+ BL, BR, BD, BT, LD, LT, RD, RT, I),
ccwx,
ccwy,
ccwz,
import qualified Face ( Face(..), center )
import FunctionValues ( FunctionValues, eval, rotate )
import Misc ( all_equal, disjoint )
-import Point ( Point(..), dot )
-import Tetrahedron ( Tetrahedron(..), barycenter, c, volume )
+import Point ( Point( Point ), dot )
+import Tetrahedron (
+ Tetrahedron(Tetrahedron, function_values, v0, v1, v2, v3),
+ barycenter,
+ c,
+ volume )
data Cube = Cube { i :: !Int,
j :: !Int,