6 import Cube (Cube(Cube))
7 import FunctionValues (FunctionValues(FunctionValues))
8 import Tests.FunctionValues
10 instance Arbitrary Cube where
12 (Positive h') <- arbitrary :: Gen (Positive Double)
13 i' <- choose (coordmin, coordmax)
14 j' <- choose (coordmin, coordmax)
15 k' <- choose (coordmin, coordmax)
16 fv' <- arbitrary :: Gen FunctionValues
17 return (Cube h' i' j' k' fv')
19 coordmin = -268435456 -- -(2^29 / 2)
20 coordmax = 268435456 -- +(2^29 / 2)
25 -- | Since the grid size is necessarily positive, all tetrahedrons
26 -- (which comprise cubes of positive volume) must have positive volume
28 -- prop_all_volumes_positive :: Cube -> Property
29 -- prop_all_volumes_positive c =
30 -- (delta > 0) ==> (null nonpositive_volumes)
33 -- ts = tetrahedrons c
34 -- volumes = map volume ts
35 -- nonpositive_volumes = filter (<= 0) volumes